feat: make mobile setup-code pairing one step#98243
Conversation
|
Codex review: found issues before merge. Reviewed June 30, 2026, 3:09 PM ET / 19:09 UTC. Summary PR surface: Source +463, Tests +274, Docs +48, Other +334. Total +1119 across 22 files. Reproducibility: not applicable. as a bug reproduction: this PR implements a requested feature. Source and CI inspection do reproduce merge blockers, including the setup-short-code lint failure and docs-map failure on the PR head. Review metrics: 2 noteworthy metrics.
Stored data model 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:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Fix the concrete lint, docs-map, iOS scheme, stale-helper, and Telegram-doc blockers, then merge only if maintainers accept the pre-auth short-code and silent node-approval boundary. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction: this PR implements a requested feature. Source and CI inspection do reproduce merge blockers, including the setup-short-code lint failure and docs-map failure on the PR head. Is this the best way to solve the issue? No in the current patch state: the implementation uses plausible existing bootstrap seams, but the iOS short-code scheme, CI blockers, stale helper, docs mismatch, and security boundary need resolution before this is the best mergeable solution. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 66e676d29b92. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +463, Tests +274, Docs +48, Other +334. Total +1119 across 22 files. View PR surface stats
Security concerns:
Acceptance criteria:
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
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5db4259564
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let scheme = self.manualTLS ? "wss" : "ws" | ||
| if let link = GatewayConnectDeepLink.fromGatewayURL("\(scheme)://\(host):\(self.manualPort)") { |
There was a problem hiding this comment.
Redeem local short codes over the correct scheme
For a fresh install, initializeState() seeds the onboarding gateway to openclaw.local:18789 while manualTLS remains at its default true, but Gateway TLS defaults to disabled. In that common default-local setup, an 8-character short code printed by openclaw qr points to a ws:// setup payload, yet this helper redeems it as https://openclaw.local:18789/api/v1/pairing/setup-code/redeem, so redemption fails before the app can retrieve the real payload. The short-code path needs to use/ask for the correct local scheme (and the Settings helper has the same construction) instead of assuming TLS for the default host.
Useful? React with 👍 / 👎.
|
Split this combined PR into smaller reviewable pieces:
Closing this combined branch so review can happen on the focused PRs. |
Closes #98242
What Problem This Solves
Resolves a problem where fresh mobile users had to perform QR/setup-code entry plus separate device/node approval steps before iOS or Android could land connected to the Gateway.
Why This Change Was Made
This makes the existing QR/setup-code bootstrap path the one-step mobile onboarding baseline: the setup payload configures the app, the Gateway approves the fresh native mobile device handoff, and the matching fresh node pairing is approved through the same bounded setup-code bootstrap. It also adds an 8-character gateway-local short-code redemption seam for cases where the app already knows which Gateway URL to contact.
The security boundary stays narrow: setup bootstrap keeps the bounded node/operator profile, does not grant
operator.adminoroperator.pairing, short codes are TTL-bound and single-use, and insecure public Gateway URLs still fail closed outside loopback/private LAN allowances.User Impact
Users can scan a QR code or paste a setup code and land connected without walking through separate pending approvals for the fresh mobile device and node. Operators still get explicit approval boundaries for later role, scope, capability, or pairing upgrades.
Evidence
0afterward.Connected/Gateway Onlinefor127.0.0.1:19001; redacted GIF generated locally from that run.node scripts/run-vitest.mjs src/pairing/setup-short-code.test.ts src/gateway/server-http.probe.test.ts src/cli/qr-cli.test.tsnode scripts/run-vitest.mjs src/gateway/server.auth.control-ui.test.ts --testNamePattern "qr setup code"node scripts/run-tsgo.mjs -p test/tsconfig/tsconfig.test.src.json --incremental --tsBuildInfoFile .artifacts/tsgo-cache/test-src.tsbuildinfoswift test --filter GatewaySetupShortCodeRedeemerTestsfromapps/shared/OpenClawKitnode scripts/format-docs.mjs --check docs/cli/qr.md docs/channels/pairing.md docs/gateway/protocol.mdnode scripts/check-docs-mdx.mjs docs/cli/qr.md docs/channels/pairing.md docs/gateway/protocol.mdnode scripts/docs-link-audit.mjs docs/cli/qr.md docs/channels/pairing.md docs/gateway/protocol.mdgit diff --check.agents/skills/autoreview/scripts/autoreview --mode local --prompt-file /tmp/openclaw-qr-setup-pr-prep.mdreturnedautoreview clean: no accepted/actionable findings reported.Notes:
GatewaySettingsStore.swift,NodeAppModel.swift,TalkModeManager.swift,ChatViewModel.swift, andRealtimeTalkRelaySession.swift.check:changedwas skipped by request after the local Crabbox binary/toolbox path failed before running the repo check.