Skip to content

feat(onboarding): require explicit AI choice in desktop and Control UI - #140336

Merged
steipete merged 4 commits into
mainfrom
codex/explicit-ai-onboarding
Sep 6, 2026
Merged

steipete merged 4 commits into
mainfrom
codex/explicit-ai-onboarding

Conversation

@steipete

@steipete steipete commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Related: #139675

What Problem This Solves

Fixes an issue where opening first-run setup in the desktop companion or Control UI would start the first detected provider before the user selected it. Fresh installations also lacked clear install/custom-endpoint actions and native-conversation consent in the shared Web UI. This completes the companion half of the onboarding repair prompted by community reports of missing provider choices.

Why This Change Was Made

Model Setup now consumes the shared setup contract landed in #139675: read-only detection, explicit typed provider actions, and an unchecked native discovery choice when the server requires it. Tauri opens this actual shared page; both saved firstRun=1 links and new firstRun=explicit links preserve the intended flow.

The old automatic-selection owner was ui/src/pages/model-setup/first-run-setup.ts. The provider view did not distinguish install/custom actions or render server consent metadata. Recovery also discarded admitted wizards on disconnect and treated cancellation as complete before the Gateway acknowledged it. The repair keeps the admitted wizard bound to the authenticated hello scope, agent, connection revision and setup visit. Reconnect reads its next step without repeating authentication or its last answer; uncertain cancellation retains its receipt and visible recovery action.

A URL-only change would leave automatic work in the shared page. Replaying authentication after a disconnect could repeat an already committed operation. Clearing the receipt when Cancel is clicked would mistake a request for acknowledgment. Those approaches are deliberately avoided; no new receipt fields, storage semantics, recovery deadlines, provider list or installer were introduced.

User Impact

  • Opening setup only detects available access. Selecting, testing, installing or saving requires a click, and failure/cancellation never picks another provider.
  • Official installable providers, including Meta, expose Review & install and continue into their own capability review/authentication flow. Custom endpoints expose Set up endpoint, with the existing local-Gateway check and precise host-side remote handoff.
  • Fresh installations show native conversation discovery unchecked and send the explicit choice to the server. Configured upgrades keep their existing preferences.
  • Connection loss can resume the same admitted wizard. Account or authority changes retire old UI requests. Missing sessions and unconfirmed cancellation remain visible and recoverable; late cancellation cannot clear another tab's newer request.

Evidence

Final head: 6f6f9b67ddec03494baa145e13ee9e26800c1173, based on landed prerequisite 64bf824613261007a3f452974d63f83d6db7f512.

  • Focused Model Setup proof: 322 passed (315 UI cases plus seven actual Gateway-handler/UI compositions). Command: OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs ui/src/pages/model-setup src/gateway/server-methods/system-agent-setup-control-ui.test.ts.
  • Real-browser Model Setup suites: 37 passed across eight files. The initial-connect splash and explicit Custodian-to-Channels handoff also passed. Command: node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner <focused file or model-setup filter>.
  • Test-lane ownership: 24 passed in test/vitest-projects-config.test.ts, retaining exact membership and exclusion assertions. Scope replacement, protected cancellation, missing-session recovery and cancellation coalescing regressions failed at their intended boundaries before repair.
  • pnpm check:changed: passed for the full candidate and each subsequent test-only correction, including all applicable type, export, lint and policy guards. Testbox runs: full candidate, runner and formatting corrections, inventory, explicit handoff. Each wrapper exited 0 and its lease completed; the backing workflow may show cancellation after the successful one-shot lease closes.
  • pnpm protocol:check, pnpm ui:i18n:verify, focused UI test type graphs, and git diff --check: passed. Fresh independent autoreview before every commit: clean at P0/P1, no accepted/actionable findings. Native review artifacts validate for the final head.
  • Packaged real-Gateway/browser proof passed all nine checks and six phases on 9c4826e0bbd4b3d55b7b2043e449e92999002962 (run). A fresh candidate built with the normal public-package pipeline starts without Meta; the actual selected-agent Web UI displays unchecked consent and sends only setup detection before the click. It then performs managed capability approval, installation, authentication, model testing, exact route/profile persistence and onboarding handoff. Both first-run link forms survive restart/relaunch without replaying setup or inference. Installing Codex later preserves both catalog opt-outs and the selected route. Gateway HTTP/WebSocket traffic is real; provider HTTP is synthetic. The final head differs only in the Custodian E2E fixture, verified by an otherwise-empty Git diff. No live Meta account or native Tauri window launch is claimed.
  • Rust tools are unavailable locally and were not installed. Final exact-head CI is green (CI, Linux/macOS companion). Current-head ClawSweeper review is ready with no remaining items.

CI found stale fixture assumptions, a UI-only runner receiving a Node-backed composition test, and Rust formatting differences. These are corrected with assertions intact. An unrelated release-navigation failure from main was repaired by its existing owner in #140337; its merge ancestry is verified. Two package-harness gaps—a passive brand icon fixture and the configured-page button name—were corrected without relaxing egress, authentication, persistence or no-replay assertions.

Actual source UI in isolated Chromium, with the same synthetic Gateway fixture and viewport on both revisions. Before: opening the page already started provider activation. After: detection stops at the unchecked discovery choice and provider buttons; Meta/custom actions are visible. The after flow explicitly clicked one provider, cancelled it, and observed no fallback. Captures were inspected for secrets, private data and unrelated desktop content before upload. The after flow was recaptured on the final head; its report records detection only before the click and no fallback after cancellation. Published image downloads were independently verified against the inspected SHA-256 hashes.

Before startup After startup
Provider activation started on load Detection only with unchecked discovery consent
Provider action comparison
Before After
Generic sign-in actions hidden under more options Visible custom endpoint and managed install actions
Actual packaged Gateway: capability review and authentication form

The credential field was empty and masked before entry. Captures contain only the isolated fixture's data.

Capability review Provider authentication form
Meta package capabilities before approval Meta credential form before entering the synthetic key

Production/test delta against the landed base: +301 production (+481/-180; shared UI +292, native Rust +9), +2,094 tests/fixtures (+2,362/-268, including colocated Rust tests), and +21 docs (+30/-9). Total: 33 files, +2,873/-457. Feature growth is explicitly authorized. Consent presentation and lifecycle recovery are partly funded by removing automatic candidate activation, its host callback, the obsolete fallback tail, duplicate verification reset, the one-call provider-reset wrapper, and implicit credential selection. No baseline, snapshot, assertion or dependency-policy weakening.

Credits: builds on RoboClaw's recovered desktop/shared-UI draft and Peter Steinberger's requested behavior. The recovered commit retains RoboClaw's original author and Peter's human contribution trailers.

Use the shared Model Setup contract for explicit provider selection, managed
plugin installation, local custom endpoints, and native conversation consent.
Resume admitted setup only for its authenticated Gateway owner and preserve
unresolved activation receipts when cancellation or reconnect is ambiguous.

Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 6, 2026 17:43
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui app: linux size: XL maintainer Maintainer-authored PR labels Sep 6, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 3:01 PM ET / 19:01 UTC.

ClawSweeper review

What this changes

Makes desktop and Control UI setup require an explicit provider choice, expose installation and custom-endpoint actions, collect native-conversation consent, and preserve setup across reconnects and uncertain cancellation.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main and the latest release retain automatic provider selection, and the merged prerequisite explicitly deferred Control UI/Tauri parity. No actionable introduced defect was found.

Priority: P2
Reviewed head: 6f6f9b67ddec03494baa145e13ee9e26800c1173

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent implementation with meaningful lifecycle and upgrade coverage and no supported blocking finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-author exemption applies. Submitted Chromium evidence covers the shared page’s choices and cancellation with a synthetic Gateway; it is not live-provider proof, and linked images could not be independently retrieved in this review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-author exemption applies. Submitted Chromium evidence covers the shared page’s choices and cancellation with a synthetic Gateway; it is not live-provider proof, and linked images could not be independently retrieved in this review.
Evidence reviewed 8 items Current main still selects a provider automatically: The inspected main implementation invokes the first eligible candidate from the first-run flow without a user click. The PR removes that loop and stops fresh detection before verification or activation.
Latest release retains the same behavior: The supplied latest release, v2026.9.2, also contains the automatic candidate activation loop; it does not already deliver this PR’s central change.
Merged prerequisite is complementary: The supplied GitHub context verifies #139675 merged at this SHA and explicitly deferred shared Control UI/Tauri parity. Its provider catalog, consent metadata, and hosted setup APIs are reused here; no new provider installer or Codex runtime contract is introduced.
Findings None None.
Security None None.

How this fits together

Desktop onboarding opens the shared Control UI Model Setup page, which discovers providers through the selected Gateway. Explicit user actions enter the Gateway’s existing setup wizard, then verification leads into chat or guided onboarding.

flowchart TD
  A[Desktop or browser setup] --> B[Gateway provider discovery]
  B --> C[Provider choices and discovery consent]
  C --> D[Explicit user action]
  D --> E[Gateway setup wizard]
  E --> F[Model verification]
  E --> G[Reconnect or cancellation recovery]
  G --> E
  F --> H[Chat or guided onboarding]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +292, Tests +2084, Docs +21, Other +19. Total +2416 across 33 files.

View PR surface stats
Area Files Added Removed Net
Source 8 470 178 +292
Tests 22 2348 264 +2084
Docs 1 30 9 +21
Config 0 0 0 0
Generated 0 0 0 0
Other 2 25 6 +19
Total 33 2873 457 +2416

Review metrics

Metric Value Why it matters
Production versus validation growth Production +301 lines; tests and fixtures +2,094 lines The body explains the production growth as explicit consent and lifecycle handling, while the larger validation delta exercises recovery and preference preservation.

Technical review

Best possible solution:

Keep one shared explicit-choice setup flow backed by the existing Gateway wizard, server-owned consent rules, and visible recovery actions.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: opening first-run setup with an eligible detected candidate reaches automatic activation on current main and v2026.9.2. Runtime reproduction was not executed during this read-only review.

Is this the best way to solve the issue?

Yes. Removing automatic activation at its shared UI owner and consuming the existing setup contract avoids a desktop-only workaround or parallel provider implementation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 7d95c2f50bb9.

Labels

Label justifications:

  • P2: This is a bounded onboarding improvement that removes unsolicited provider activation and improves setup recovery.
  • 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: The maintainer-author exemption applies. Submitted Chromium evidence covers the shared page’s choices and cancellation with a synthetic Gateway; it is not live-provider proof, and linked images could not be independently retrieved in this review.

Evidence

What I checked:

  • Current main still selects a provider automatically: The inspected main implementation invokes the first eligible candidate from the first-run flow without a user click. The PR removes that loop and stops fresh detection before verification or activation. (ui/src/pages/model-setup/first-run-setup.ts:429, 7d95c2f50bb9)
  • Latest release retains the same behavior: The supplied latest release, v2026.9.2, also contains the automatic candidate activation loop; it does not already deliver this PR’s central change. (ui/src/pages/model-setup/first-run-setup.ts:429, 3928bad9badf)
  • Merged prerequisite is complementary: The supplied GitHub context verifies feat(onboarding): require explicit AI provider selection #139675 merged at this SHA and explicitly deferred shared Control UI/Tauri parity. Its provider catalog, consent metadata, and hosted setup APIs are reused here; no new provider installer or Codex runtime contract is introduced. (64bf82461326)
  • Reconnect authority and cancellation boundaries: The page checks authenticated recovery scope, connection revision, agent, setup mode, and current admin access before resuming. The runner retires old handles, resumes without replaying an answer, and retains a wizard when cancellation is declined or uncertain. The corresponding owner-change, late-result, protected-cancellation, and application-recreation tests were inspected. (ui/src/pages/model-setup/model-setup-page.ts:283, 6f6f9b67ddec)
  • Existing consent and upgrade contract: The UI sends nativeSessionCatalogsEnabled only when detection requests a preference. Existing server logic owns that decision and persistence; the new handler/UI composition covers unwritten, initialized, Doctor, onboarding, upgrade, authored-preference, and additional-catalog cases. Saved firstRun=1 links remain supported alongside firstRun=explicit. (src/gateway/server-methods/system-agent-setup-control-ui.test.ts:83, 6f6f9b67ddec)
  • Review continuity: The previous completed review retained no findings. Comparing its pinned head with this head shows only the channel-onboarding browser test gaining an explicit provider click and a matching screenshot name; production code is unchanged. (ui/src/e2e/custodian-channel-onboarding.e2e.test.ts:132, 6f6f9b67ddec)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

History

Review history (3 earlier review cycles)
  • reviewed 2026-09-06T17:50:15.042Z sha 4660483 :: blocked before merge. :: none
  • reviewed 2026-09-06T18:31:33.328Z sha d8ae057 :: blocked before merge. :: none
  • reviewed 2026-09-06T18:41:34.348Z sha 9c4826e :: needs maintainer review before merge. :: none

Keep the real handler/UI consent cases in the existing isolated Gateway
runner with the shared UI DOM setup. Update the splash heading expectation
and apply the Rust formatter's navigation-test layout.
@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Sep 6, 2026
@steipete
steipete merged commit e70faf7 into main Sep 6, 2026
164 checks passed
@steipete
steipete deleted the codex/explicit-ai-onboarding branch September 6, 2026 19:07
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
openclaw#140336)

* feat(linux): require explicit AI onboarding choice

Use the shared Model Setup contract for explicit provider selection, managed
plugin installation, local custom endpoints, and native conversation consent.
Resume admitted setup only for its authenticated Gateway owner and preserve
unresolved activation receipts when cancellation or reconnect is ambiguous.

Worked on by:
- @steipete

Co-authored-by: steipete <[email protected]>

* test(onboarding): run setup composition in the Gateway test lane

Keep the real handler/UI consent cases in the existing isolated Gateway
runner with the shared UI DOM setup. Update the splash heading expectation
and apply the Rust formatter's navigation-test layout.

* test(onboarding): verify isolated setup fixture ownership

* test(onboarding): select AI before the channel handoff

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: steipete <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: linux app: web-ui App: web-ui gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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.

2 participants