fix: keep iOS LAN QR pairing authenticated after bootstrap#98066
Conversation
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Codex review: needs real behavior proof before merge. Reviewed July 2, 2026, 5:11 PM ET / 21:11 UTC. Summary PR surface: Other +92. Total +92 across 2 files. Reproducibility: yes. at source level: current Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow predicate/test after maintainers accept the private-LAN token-persistence boundary and attach redacted iPhone LAN QR pairing proof or explicitly override the proof gate. Do we have a high-confidence way to reproduce the issue? Yes at source level: current Is this the best way to solve the issue? Yes for the code shape: it reuses the existing local-network setup-code trust predicate and keeps public plaintext hosts non-persistent. Merge readiness still depends on real-device proof or explicit maintainer override for that proof gap. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 968aa51b8000. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Other +92. Total +92 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
cd9a130 to
9090b3d
Compare
|
Maintainer repair complete and land-ready at
No remaining proof gaps for this bounded fix. |
9090b3d to
4c1278d
Compare
|
Merged via squash.
|
…98066) * Persist iOS LAN bootstrap handoff tokens * test: cover iOS LAN bootstrap reconnect auth * test(ios): consolidate LAN bootstrap reconnect proof --------- Co-authored-by: Peter Steinberger <[email protected]>
Fixes #98064
What Problem This Solves
Fixes an issue where users scanning
/pair qrwith the iOS app against a LAN Gateway could see the Control/Gateway card become online while Chat stayed disconnected and the Gateway still reported that a token was required.In the real repro, the Gateway accepted the setup bootstrap once, then the next iPhone node/chat WebSocket reconnected with no auth and was rejected as
token_missing.Why This Change Was Made
The iOS setup-code parser already allows plaintext
ws://bootstrap URLs when the host is local-network scoped, such as192.168.x.x, while still rejecting public plaintext hosts. This change aligns bootstrap handoff token persistence with that same local-network boundary:wss://remains allowed, publicws://remains non-persistent, and private LANws://now persists the bounded device tokens issued by the Gateway after bootstrap succeeds.This does not change token validation, expired setup-code handling, or public/non-local plaintext WebSocket policy.
User Impact
Users can scan a fresh
/pair qrcode from a phone on the same LAN and keep the iOS app connected after the one-time bootstrap token is consumed. Chat should no longer fall back toauth=noneimmediately after an otherwise successful local pairing.Evidence
AI-assisted: yes, Codex.
2026.6.11-beta.2, where Control showed the Main gateway online but Chat showedDisconnected/not connected.device pairing auto-approved ... role=node, followed byunauthorized ... client=iPhone node v2026.6.10 role=node scopes=0 auth=none ... reason=token_missing, thenclosed before connect ... gateway token missing.apps/shared/OpenClawKit/Sources/OpenClawKit/DeepLinks.swiftaccepts private LANws://setup-code hosts throughLoopbackHost.isLocalNetworkHost, while the pre-fixGatewayChannel.shouldPersistBootstrapHandoffTokens()only persisted bootstrap-issued tokens forwss://or loopback.GatewayNodeSessionTestsverifies that a bootstrap hello fromws://192.168.x.x:18889persists the issued node and operator device tokens.GatewayNodeSessionTests.private lan bootstrap reconnect uses persisted handoff tokensimulates a fresh LAN bootstrap overws://192.168.x.x:18889, disconnects after the one-time bootstrap succeeds, reconnects with no bootstrap token, and asserts the next connect request sends the persistedtoken=lan-node-tokenwhile sending nobootstrapTokenand nodeviceToken. This is the source-level regression for the observedauth=none/token_missingreconnect failure.ws://example.invalidnot persisting bootstrap handoff tokens.git diff --check.python .agents\skills\autoreview\scripts\autoreview --mode branch --base upstream/main --thinking lowreportedautoreview clean: no accepted/actionable findings reported.swift/Xcode installed. CI should run the OpenClawKit Swift/iOS lanes on the PR head.auth=noneafter the bootstrap token was consumed.