Repository navigation
fix: recover Control UI access after device-auth upgrades - #118231
fuller-stack-dev merged 10 commits into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 6:30 PM ET / 22:30 UTC. ClawSweeper reviewWhat this changesThe PR makes Merge readinessKeep this PR open for maintainer security-boundary review. Current main still offers only a shared-token dashboard URL and no host-issued browser recovery handoff, so the linked upgrade-lockout problem remains necessary; the proposed flow reuses the existing Control UI bootstrap and device-pairing mechanisms without a concrete patch defect found in this pass. Priority: P1 Review scores
Verification
How this fits together
flowchart LR
Host[Trusted Gateway host] --> Dashboard[openclaw dashboard]
Dashboard --> Ready[Verify Gateway readiness and listener ownership]
Ready --> Bootstrap[Issue one-time Control UI bootstrap]
Bootstrap --> Browser[Control UI browser URL fragment]
Browser --> Gateway[Gateway authentication and device pairing]
Gateway --> Device[Durable device credential]
Device --> Reload[Authenticated Control UI reload]
Decision needed
Why: The implementation is a targeted repair, but this is a deliberate authentication-policy choice: it creates a durable browser credential from a trusted-host command and therefore needs explicit owner acceptance beyond ordinary patch review. Before merge
Agent review detailsSecurityNone. PR surfaceSource +92, Tests +127, Docs +22. Total +241 across 14 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land one canonical dashboard recovery flow only after an auth owner confirms that a locally issued, single-use Control UI bootstrap may silently pair the browser and the exact head finishes its security and Gateway checks. Do we have a high-confidence way to reproduce the issue? Yes, from source: current Is this the best way to solve the issue? Yes, conditionally: issuing the recovery credential at the trusted dashboard command and enforcing its lifetime, device binding, replay prevention, and shared-auth generation at the existing bootstrap/pairing owners is more coherent than weakening ordinary remote token pairing. Maintainer confirmation is still needed for that security policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a1c2009b91b9. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Maintainer policy decision: accept the bounded trusted-host Control UI bootstrap. The one-time token remains purpose-, scope-, device-, replay-, and shared-auth-generation-bound; ordinary shared-token remote access remains pairing-gated. Exact-head CI run 30770033484 passed all 64 jobs, and the reported packaged-runtime browser acceptance covers initial connect, URL cleanup, reload, replay rejection, and the shared-token negative control. |
|
Merged via squash.
|
…18231) * fix: recover Control UI pairing from dashboard * test: prove dashboard credential rotation * test: complete gateway auth generation fixture * test: restore QR device token verifier * fix: preserve headless dashboard recovery
Closes #118229
What Problem This Solves
Fixes an issue where users opening the remote Control UI after a device-auth upgrade could be stranded at a generic Gateway connection error when the browser no longer had a usable paired-device credential.
Why This Change Was Made
openclaw dashboardnow mints a short-lived, single-use Control UI bootstrap after proving Gateway readiness and local listener ownership. The bootstrap provisions a durable device-bound credential for the current shared-auth generation, is removed from the browser URL, and cannot be replayed; ordinary shared-token remote access remains pairing-gated.The legacy
urlJSON field keeps its existing Quick Chat contract, whilebrowserUrlexposes the browser-specific bootstrap URL. If automatic delivery fails in a headless or SecretRef-managed setup, the CLI points to that explicit JSON handoff. The login gate now points operators to the exact recovery command before listing manual pairing commands.User Impact
Operators can recover Control UI access with one trusted-host command instead of diagnosing a surprising post-upgrade browser lockout. The recovered browser stays connected across reloads, while copied shared Gateway tokens still cannot bypass device pairing.
Evidence
Live packaged-runtime acceptance on an OCM-managed macOS instance behind Tailscale Serve:
Focused exact-head proof:
node scripts/run-vitest.mjs src/commands/dashboard.links.test.ts src/commands/dashboard.test.ts src/commands/dashboard/json.test.ts ui/src/components/login-gate.test.ts— 35 passednode scripts/run-vitest.mjs src/cli/qr-dashboard.integration.test.ts— 2 passed; covers resolved and unresolved SecretRef headless recoverynode scripts/run-vitest.mjs src/gateway/server.auth.control-ui.test.ts -t 'silently approves control ui operator bootstrap tokens with control-ui purpose'— 1 passed; covers reload, one-time replay rejection, shared-auth issuer binding, and auth-rotation invalidationnode scripts/run-vitest.mjs ui/src/i18n/lib/registry.test.ts— 41 passedgit diff --check— passedAI-assisted: yes