Skip to content

fix: recover Control UI access after device-auth upgrades - #118231

Merged
fuller-stack-dev merged 10 commits into
openclaw:mainfrom
fuller-stack-dev:codex/dashboard-bootstrap-recovery
Aug 2, 2026
Merged

fuller-stack-dev merged 10 commits into
openclaw:mainfrom
fuller-stack-dev:codex/dashboard-bootstrap-recovery

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Aug 2, 2026 •

Copy link
Copy Markdown
Member

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 dashboard now 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 url JSON field keeps its existing Quick Chat contract, while browserUrl exposes 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:

  • Before: the browser showed a generic “Could not connect” state; the valid shared token was rejected by device pairing.
  • After: the dashboard command opened a one-time browser URL, initial connection succeeded, and the bootstrap fragment disappeared from the address bar.
  • Reload remained connected using the durable per-device credential.
  • Replaying the bootstrap URL was rejected.
  • A fresh browser using only the ordinary shared token remained pairing-required.
  • Gateway health/readiness, Discord, Telegram, plugins, and memory remained healthy after deployment.

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 passed
  • node scripts/run-vitest.mjs src/cli/qr-dashboard.integration.test.ts — 2 passed; covers resolved and unresolved SecretRef headless recovery
  • node 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 invalidation
  • node scripts/run-vitest.mjs ui/src/i18n/lib/registry.test.ts — 41 passed
  • git diff --check — passed
  • Fresh autoreview on the full patch and review delta — no accepted/actionable findings

AI-assisted: yes

@fuller-stack-dev
fuller-stack-dev requested a review from a team as a code owner August 2, 2026 22:01
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime commands Command implementations size: M maintainer Maintainer-authored PR labels Aug 2, 2026
@fuller-stack-dev fuller-stack-dev self-assigned this Aug 2, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Aug 2, 2026
@clawsweeper

clawsweeper Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 6:30 PM ET / 22:30 UTC.

ClawSweeper review

What this changes

The PR makes openclaw dashboard issue a short-lived, single-use Control UI browser bootstrap, exposes it as an additive browserUrl JSON field, and binds the resulting device credential to the current shared Gateway-auth generation.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep 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
Reviewed head: a96a41a2ba13b610fd2ee927b470cc18eb8760c1
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is focused, source-backed, and regression-tested, with the remaining work being auth-policy confirmation and completion of exact-head checks rather than a code defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a MEMBER-authored PR, so the external-contributor real-behavior-proof gate does not apply; its body nevertheless reports packaged-runtime validation that should be checked by the landing owner alongside exact-head CI.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a MEMBER-authored PR, so the external-contributor real-behavior-proof gate does not apply; its body nevertheless reports packaged-runtime validation that should be checked by the landing owner alongside exact-head CI.
Evidence reviewed 7 items Current-main gap: Current main emits the legacy url, httpUrl, wsUrl, port, and token flag from dashboard --json; it does not issue a browser bootstrap or return browserUrl, so an unpaired remote browser still has no command-driven recovery handoff.
Proposed owner-boundary repair: The PR issues a Control UI-purpose bootstrap only after dashboard readiness and listener verification, then uses it for browser/clipboard delivery while retaining the old shared-auth JSON url contract.
Existing browser-side containment: The existing Control UI startup path reads bootstrapToken from the URL fragment, stores it only as a pending connection input, and removes the fragment before normal UI use; the PR does not add a query-string secret path.
Findings None None.
Security None None.

How this fits together

openclaw dashboard is the trusted-host CLI route into the Control UI. It resolves and verifies the local Gateway, hands a browser a one-time bootstrap, and the Gateway converts that bootstrap into a durable device credential used on later browser reconnects.

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]
Loading

Decision needed

Question Recommendation
Should a trusted Gateway-host invocation of openclaw dashboard be allowed to silently bootstrap one browser into the bounded operator device profile, while keeping ordinary shared-token remote access pairing-gated? Accept bounded host bootstrap: Approve the one-time, device-bound recovery handoff after exact-head checks and the current review feedback confirm replay and auth-rotation protections.

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

  • Resolve merge risk (P1) - This merges a new host-authorized route to mint an operator device credential, so the final exact-head CI and a maintainer confirmation of the one-time bootstrap policy are material security-boundary gates.
  • Resolve merge risk (P1) - The latest ClawSweeper comment and its Rank-up moves could not be retrieved during this read-only pass because GitHub API DNS failed; confirm those moves are addressed before landing.
  • Complete next step (P2) - A protected maintainer-authored authentication change needs owner policy confirmation and final exact-head CI review, not an automated repair branch.
Agent review details

Security

None.

PR surface

Source +92, Tests +127, Docs +22. Total +241 across 14 files.

View PR surface stats
Area Files Added Removed Net
Source 6 125 33 +92
Tests 5 157 30 +127
Docs 3 34 12 +22
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 14 316 75 +241

Review metrics

Metric Value Why it matters
CLI JSON compatibility 1 additive browser URL field; legacy url retained Desktop and scripting consumers keep the shared-auth URL contract while browser callers receive the new one-time handoff explicitly.

Stored data model

Persistent data-model change detected: vector/embedding metadata: src/gateway/server/ws-connection/connect-auth.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Finish auth-boundary validation (recommended)
    Wait for the exact-head Gateway/security checks, verify the latest Rank-up moves, and then merge only if replay and auth-generation invalidation remain covered.
  2. Pause for policy revision
    Pause the PR if maintainers do not want a trusted-host command to create a durable operator browser credential without manual approval.

Technical review

Best 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 openclaw dashboard only delivers the ordinary shared-auth URL, while the existing Control UI bootstrap and pairing flow require a separate valid bootstrap to create the durable device credential. The PR body also reports a packaged-runtime reproduction, but that live artifact was not independently accessible in this pass.

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.

Labels

Label changes:

  • add P1: A post-upgrade Control UI lockout prevents existing remote operators from using an admin surface until they discover a recovery path.
  • add merge-risk: 🚨 security-boundary: The PR changes how a trusted host can mint and bind an operator browser credential, so replay, scope, and auth-generation behavior must remain deliberate.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a MEMBER-authored PR, so the external-contributor real-behavior-proof gate does not apply; its body nevertheless reports packaged-runtime validation that should be checked by the landing owner alongside exact-head CI.

Label justifications:

  • P1: A post-upgrade Control UI lockout prevents existing remote operators from using an admin surface until they discover a recovery path.
  • merge-risk: 🚨 security-boundary: The PR changes how a trusted host can mint and bind an operator browser credential, so replay, scope, and auth-generation behavior must remain deliberate.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a MEMBER-authored PR, so the external-contributor real-behavior-proof gate does not apply; its body nevertheless reports packaged-runtime validation that should be checked by the landing owner alongside exact-head CI.

Evidence

What I checked:

  • Current-main gap: Current main emits the legacy url, httpUrl, wsUrl, port, and token flag from dashboard --json; it does not issue a browser bootstrap or return browserUrl, so an unpaired remote browser still has no command-driven recovery handoff. (src/commands/dashboard.ts:197, a1c2009b91b9)
  • Proposed owner-boundary repair: The PR issues a Control UI-purpose bootstrap only after dashboard readiness and listener verification, then uses it for browser/clipboard delivery while retaining the old shared-auth JSON url contract. (src/commands/dashboard.ts:35, a96a41a2ba13)
  • Existing browser-side containment: The existing Control UI startup path reads bootstrapToken from the URL fragment, stores it only as a pending connection input, and removes the fragment before normal UI use; the PR does not add a query-string secret path. (ui/src/app/startup-settings.ts:105, a1c2009b91b9)
  • Auth rotation is covered at the credential issuer boundary: The PR classifies the Control UI-purpose bootstrap session as shared-Gateway-authenticated so issuance receives the current generation; the changed Gateway suite asserts reload success, replay rejection, and rejection after a generation change. (src/gateway/server/ws-connection/connect-auth.ts:412, a96a41a2ba13)
  • Focused regression coverage: The branch adds dashboard link/JSON and Control UI recovery copy coverage, plus a Gateway control-UI suite case for durable reload, one-time replay rejection, and shared-auth generation invalidation. Tests were inspected but not executed because this was a read-only review. (src/gateway/server.auth.control-ui.suite.ts:1836, a96a41a2ba13)
  • Current feature provenance: Blame attributes the current shared-auth generation enforcement and the dashboard JSON contract to the same current auth/dashboard area revision, making Peter Steinberger the strongest current-main routing candidate. (src/gateway/server/ws-connection/connect-auth.ts:414, 641a4bf7b09b)

Likely related people:

  • Peter Steinberger: Current-main blame attributes both the dashboard JSON interface and shared Gateway-auth generation enforcement to this revision; the PR changes their interaction. (role: recent authentication-path owner; confidence: high; commits: 641a4bf7b09b; files: src/commands/dashboard.ts, src/gateway/server/ws-connection/connect-auth.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Confirm the latest ClawSweeper Rank-up moves once GitHub comment access is available.
  • Review the completed exact-head Gateway and security checks before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

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.

@fuller-stack-dev
fuller-stack-dev merged commit 8df95cc into openclaw:main Aug 2, 2026
133 of 140 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@fuller-stack-dev
fuller-stack-dev deleted the codex/dashboard-bootstrap-recovery branch August 2, 2026 22:41
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Control UI upgrades can strand browsers without a discoverable recovery path

1 participant