Repository navigation
Description
Summary
docs/gateway-node-integration.md repeatedly says official setup codes embed expiry metadata, but the Gateway payload and active Windows decoder contain only URL and bootstrap-token fields.
Current behavior
The guide describes { url, bootstrapToken, expiresAtMs }, says the decoded payload contains expiry, and retains a checklist item for a Windows expiry parser that was removed in #925.
Expected behavior
Document the upstream payload as { url, urls?, bootstrapToken }, the Windows-consumed shape as { url, bootstrapToken }, and the 10-minute lifetime as Gateway-enforced rather than serialized into the setup code.
Impact
Windows integration work can incorrectly require or implement a field that official setup codes never contain, or assume the current tray performs a client-side expiry check that no longer exists.
Evidence
- Upstream payload type and builder omit expiry: https://github.com/openclaw/openclaw/blob/d395a8e6ec2789763b746b1e96ed5870c7795bd7/src/pairing/setup-code.ts#L37-L41 and https://github.com/openclaw/openclaw/blob/d395a8e6ec2789763b746b1e96ed5870c7795bd7/src/pairing/setup-code.ts#L434-L445
- Gateway token state applies a 10-minute TTL: https://github.com/openclaw/openclaw/blob/d395a8e6ec2789763b746b1e96ed5870c7795bd7/src/infra/device-bootstrap.ts#L25-L26
- Current Windows decoder reads only
urlandbootstrapToken:openclaw-windows-node/src/OpenClaw.Connection/SetupCodeDecoder.cs
Lines 47 to 77 in 053501c
string? url = null; string? token = null; if (doc.RootElement.TryGetProperty("url", out var urlProp)) { if (urlProp.ValueKind != JsonValueKind.String) return new DecodeResult(false, Error: "Invalid gateway URL in setup code"); var decoded = urlProp.GetString() ?? ""; if (!string.IsNullOrEmpty(decoded)) { if (!GatewayUrlHelper.IsValidGatewayUrl(decoded)) return new DecodeResult(false, Error: "Invalid gateway URL in setup code"); url = decoded; } } if (doc.RootElement.TryGetProperty("bootstrapToken", out var tokenProp)) { if (tokenProp.ValueKind != JsonValueKind.String) return new DecodeResult(false, Error: "Invalid bootstrap token in setup code"); var decoded = tokenProp.GetString() ?? ""; if (decoded.Length > 512) return new DecodeResult(false, Error: "Bootstrap token exceeds 512 character limit"); if (!string.IsNullOrEmpty(decoded)) token = decoded; } if (url == null && token == null) return new DecodeResult(false, Error: "Setup code must include a gateway URL or bootstrap token"); return new DecodeResult(true, Url: url, Token: token); - The upstream documentation correction landed in docs(pairing): correct setup-code expiry payload openclaw#103943.
No open duplicate issue or PR was found.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Start date
Target date
Projects
- StatusShow more project fieldsLocal Gateway
Activity
clawsweeper commentedon Jul 10, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 10, 2026, 5:14 PM ET / 21:14 UTC.
Summary
Current main and the latest release still document an expiry field that neither the authoritative Gateway payload nor the active Windows decoder contains, and no duplicate or implementation PR owns the correction.
Reproducibility: yes. at source level. Comparing the current integration guide with
SetupCodeDecoder, the architecture guide, and the upstream payload deterministically reproduces the contract mismatch.Next step
The current mismatch is valid, confined to one guide, and has clear authoritative sources and a deterministic validation boundary.
Review details
Best possible solution:
Update only
docs/gateway-node-integration.mdto distinguish the upstream{ url, urls?, bootstrapToken }payload from the Windows{ url, bootstrapToken }result, state that Gateway token state enforces the 10-minute TTL, and remove the obsolete expiry-parser claim.Do we have a high-confidence way to reproduce the issue?
Yes, at source level. Comparing the current integration guide with
SetupCodeDecoder, the architecture guide, and the upstream payload deterministically reproduces the contract mismatch.Is this the best way to solve the issue?
Yes. A narrow documentation correction is the maintainable solution; reintroducing client-side expiry parsing would conflict with the authoritative Gateway payload and current Windows architecture.
AGENTS.md: found and applied where relevant.
Codex review notes: model internal, reasoning high; reviewed against 053501c6dfae.
Label changes
Label changes:
P3: This is a focused documentation defect that can misdirect future integration work but does not break the active runtime path.issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.clawsweeper:source-repro: Current issue advisory state selects this label.clawsweeper:queueable-fix: Current issue advisory state selects this label.clawsweeper:fix-shape-clear: Current issue advisory state selects this label.Label justifications:
P3: This is a focused documentation defect that can misdirect future integration work but does not break the active runtime path.Evidence reviewed
Acceptance criteria:
What I checked:
expiresAtMsor expiry metadata and retains a completed client-side expiry-parser checklist item. (docs/gateway-node-integration.md:210, 053501c6dfae)urlandbootstrapToken; it has no expiry field or client-side expiry check. (src/OpenClaw.Connection/SetupCodeDecoder.cs:47, 053501c6dfae){ url, bootstrapToken }, independently confirming the active Windows shape. (docs/CONNECTION_ARCHITECTURE.md:201, 053501c6dfae)PairingSetupPayloadcontainsurl, optionalurls, andbootstrapToken, whileDEVICE_BOOTSTRAP_TOKEN_TTL_MSseparately enforces a 10-minute lifetime. (d395a8e6ec27)docs/gateway-node-integration.md:358, ed218e960712)docs/gateway-node-integration.md:210, 4166e0fd63f8)Likely related people:
docs/gateway-node-integration.md,src/OpenClaw.Connection/SetupCodeDecoder.cs,tests/OpenClaw.Connection.Tests/SetupCodeDecoderTests.cs)src/OpenClaw.Connection/SetupCodeDecoder.cs,docs/CONNECTION_ARCHITECTURE.md,docs/ONBOARDING_WIZARD.md)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.steipete commentedon Jul 10, 2026
Fixed by #965 and landed on
mainas622c0e27c6b0473c57d087f595581cb9eb29c03b.The guide now documents the actual upstream
{ url, urls?, bootstrapToken }payload, the Windows-consumed{ url, bootstrapToken }shape, and Gateway-enforced token lifetime. Exact-head hosted CI passed, and native Windows validation passed./build.ps1, 2,732 Shared tests with zero failures, and 1,669 Tray tests with zero failures. Full proof: #965 (comment)