Repository navigation
feat(ui): custodian onboarding surface with option cards and first-run handoff - #110141
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eed62310ed
ℹ️ 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".
| const { gatewayUrl, token, password, bootstrapToken } = this.context.gateway.connection; | ||
| return JSON.stringify([gatewayUrl, token, password, bootstrapToken]); |
There was a problem hiding this comment.
Include stored device tokens in the session scope
When the browser authenticates via a stored device token, a same-URL reconnect can present a different credential while gatewayUrl, token, password, and bootstrapToken all remain unchanged; the browser client explicitly reads loadDeviceAuthToken for auth in ui/src/api/gateway.ts:556-569. In that scenario this scope key does not change, so the custodian transcript and any pending sensitive retry state can survive across operators on a shared browser instead of being cleared.
Useful? React with 👍 / 👎.
eed6231 to
7dedf20
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7dedf20eb1
ℹ️ 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".
| loader: async (context: ApplicationContext, { location }) => | ||
| loadModelSetupRouteData(context, location), |
There was a problem hiding this comment.
Add loaderDeps for the first-run query
When the URL changes only between /settings/model-setup and /settings/model-setup?firstRun=1, this loader is not re-run because the page does not declare loaderDeps; sibling query-driven routes such as ui/src/pages/plugins/route.ts explicitly note that query-only state needs distinct loader deps. In that same-route navigation scenario (for example clicking the active Model Setup settings-sidebar item strips the query), routeData.firstRun can stay stale, so the Open Chat button can either skip the custodian during first run or send a normal settings visit into onboarding until a full remount happens.
Useful? React with 👍 / 👎.
|
Codex review: needs maintainer review before merge. Reviewed July 17, 2026, 6:13 PM ET / 22:13 UTC. Summary PR surface: Source +1027, Tests +773. Total +1800 across 26 files. Reproducibility: not applicable. as a defect reproduction: this PR introduces a planned onboarding capability. The contributor supplied a concrete live after-fix route, chat, and Exit setup transcript for the new behavior. Review metrics: none identified. Stored data model 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 detailsBest possible solution: Land the documented custodian onboarding flow only after the designated reviewer confirms the planned first-run navigation change and required checks validate the exact head; retain the normal non-first-run chat path and the visible Exit setup recovery route. Do we have a high-confidence way to reproduce the issue? Not applicable as a defect reproduction: this PR introduces a planned onboarding capability. The contributor supplied a concrete live after-fix route, chat, and Exit setup transcript for the new behavior. Is this the best way to solve the issue? Yes, conditionally. The dedicated non-sidebar route, explicit marker parser, and first-run-only redirect form a bounded implementation that preserves the ordinary model-setup destination; the remaining question is merge approval for the documented navigation change, not a narrower mechanical repair. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against af24487b5f96. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +1027, Tests +773. Total +1800 across 26 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
Review history (3 earlier review cycles)
|
7dedf20 to
f0aa09b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 254736f97a
ℹ️ 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".
| */ | ||
| private connectionScopeKey(): string { | ||
| const { gatewayUrl, token, password, bootstrapToken } = this.context.gateway.connection; | ||
| const deviceToken = this.context.gateway.snapshot.hello?.auth?.deviceToken ?? ""; |
There was a problem hiding this comment.
Preserve device-token scope across reconnects
When the operator is authenticated via stored device auth, a transient gateway drop sets hello: null while keeping the retrying client in the snapshot (src/app/gateway-store.ts:192-198). Because this scope reads the device token only from hello, the key changes from the token to "" during the disconnect, so synchronizeClient() treats the same operator as a new scope, clears the custodian transcript, and starts a fresh welcome after reconnect. Fresh evidence beyond the prior device-token comment: the target commit now includes the hello token, but it still is not stable across the offline phase.
Useful? React with 👍 / 👎.
| }; | ||
|
|
||
| const MARKER_PATTERN = new RegExp( | ||
| `<!--\\s*${CUSTODIAN_QUESTION_MARKER}\\s*([\\s\\S]*?)\\s*-->`, |
There was a problem hiding this comment.
Add a real producer for custodian option markers
This card path only renders when replies contain the openclaw-user-input marker, but a repo-wide search finds that marker only in this parser and tests, while the real onboarding welcome is plain prose built in src/system-agent/onboarding-welcome.ts:85-98. In the actual first-run handoff, option cards therefore never appear unless the gateway is mocked to emit the hidden marker; add a server/prompt producer for the marker or avoid gating the new card UI on an unproduced contract.
Useful? React with 👍 / 👎.
|
Review response — all actionable findings addressed at head Real behavior proof (live, this head)Setup: vite dev UI (this branch) connected to an isolated same-config gateway on 1. Deep link 2. Send round-trip ( 3. "Exit setup" → normal chat surface with full chrome restored: No sidebar/nav is present in state 1-2 (onboarding chrome); the full shell returns in state 3. Finding-by-finding
Merge evidence context: hosted blacksmith runners are in a repo-wide freeze (jobs hang ~20m at "Setup Node environment"; three frozen attempts across two runs on the docs PR, a dozen frozen jobs on run 29608349378 here). Landing follows the sanctioned AGENTS.md local-fallback gates (build + check + full test) with the reason recorded in the pre-merge verification comment. |
88c2e40 to
9ba7392
Compare
Under isolate:false a custom element registered by an earlier test file keeps its own module registry, so instanceof GatewayRequestError diverges while the error shape stays stable; the branch's new custodian test files reshuffled worker packing and exposed this in usage-page.test.ts.
9ba7392 to
42edfc1
Compare
Pre-merge verificationLand-ready at exact PR head
Earlier runner-freeze context is historical, not the gate used here: run 29608349378 and run 29606946090 froze at Known proof/design gap: strict foreign-locale parity is intentionally deferred to the post-merge locale-refresh bot. The English source keys and keyless raw-copy baseline are present; foreign locale bundles were not hand-edited. Automatic PR-event i18n verification is green. |
|
Merged via squash.
|
…n handoff (openclaw#110141) * feat(ui): add custodian onboarding surface * fix(ui): reset custodian session when credentials change on the same gateway * fix(ui): include bootstrap token in custodian session ownership key * fix(ui): no replay for ambiguous user turns; send sensitive input verbatim * fix(ui): harden custodian session and route state * fix(ui): keep device-token session scope stable across transient drops * fix(ui): detect gateway scope errors structurally, not by class identity Under isolate:false a custom element registered by an earlier test file keeps its own module registry, so instanceof GatewayRequestError diverges while the error shape stays stable; the branch's new custodian test files reshuffled worker packing and exposed this in usage-page.test.ts.
What Problem This Solves
Phase 4 PR1 of the custodian onboarding redesign (plan:
docs/start/onboarding-redesign.md). After the web Control UI's first-run model-setup wizard verifies inference, the user is currently dropped onto the plain dashboard. There is no conversational onboarding surface in the browser, and the phase-3 CLI browser handoff has no dedicated page to deep-link into.Why This Change Was Made
The redesign's north star is that onboarding is a conversation with OpenClaw (the system agent), not a form. This PR gives the web UI that surface: a custodian chat page in minimal onboarding chrome, structured choices rendered as option cards (max 4 options, exactly one recommended, always skippable), and a first-run handoff from the model-setup wizard into that conversation.
User Impact
/custodian(deep-linkable as/custodian?onboarding=1for the phase-3 CLI handoff; not in the sidebar nav). Renders a conversation with the system agent over the existingopenclaw.chatgateway RPC (welcomeVariant: "onboarding"), with minimal chrome and one "Exit setup" control that restores normal chrome.openclaw-option-cardcomponent: header chip, question, 2-4 option cards with optional descriptions, one recommended accent, always-present skip. Selection replies with the exact option label so the agent-harness user-input bridge parses it.<!-- openclaw-user-input {json} -->) in the reply; ordinary prose (including numbered lists) always stays plain text, and invalid markers degrade to text. Nothing emits the marker server-side yet — that is the phase 4 PR2 follow-up; until then the page is a plain conversation.Evidence
node scripts/run-vitest.mjs.pnpm tsgo,pnpm tsgo:ui, oxlint on touched files,pnpm deadcode:exports, i18n baseline/verify,git diff --check,pnpm format— all green./custodian?onboarding=1renders minimal chrome; onboarding welcome arrives viaopenclaw.chat; send round-trip ("help" → real system-agent reply); "Exit setup" restores full chrome on the chat page.a270ba22494), bootstrap-token in the ownership key (c0ad346a370), no replay of ambiguous user turns + sensitive input sent verbatim (eed62310ed6). Final pass clean ("patch is correct", no actionable findings).