Skip to content

refactor(ui): simplify first-run activation outcomes - #140655

Merged
steipete merged 1 commit into
mainfrom
fix/first-run-outcome-owner-cleanup
Sep 7, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/first-run-outcome-owner-cleanup

Conversation

@steipete

@steipete steipete commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Related: #139140 — recoverable onboarding and model-result verification

What Problem This Solves

Maintainer-requested cleanup of the existing Control UI first-run recovery fix. The already-landed fix carried start non-admission as a separate session flag and observer argument, while the page translated wizard results into another outcome shape before updating the receipt owner.

Why This Change Was Made

Pass the wizard outcome directly to the first-run owner, which now decides whether to retain, reject, or verify its receipt. Exact start non-admission uses a local discriminated outcome; it does not manufacture a Gateway-owned rejection fact. This removes the mutable admission flag, extra callback argument, and page-level projection.

User Impact

No intended user-visible change. Generic errors remain unresolved, confirmed cancellation and pre-promotion rejection retain their existing retry semantics, and start non-admission remains distinct from an error after admission. Suspension, retirement, stale/replacement ownership, and the existing verification deadline are unchanged. No Gateway, protocol, configuration, schema, or native changes.

Evidence

  • Model Setup suite before and after: 315 tests passed across 19 files. No new test cases; only existing fixtures/assertions changed for the internal result shape.
  • Chromium activation-feedback, cancellation, and reconnect suites: 17 tests passed across 3 files.
  • pnpm ui:build passed.
  • node scripts/check-changed.mjs -- <six changed files> passed, including formatting, core-test/UI typechecks, lint, i18n, and applicable guards.
  • Fresh isolated Codex autoreview: no actionable P0–P2 findings.
  • git diff --check passed.

Production +37/-42 (net -5); tests +10/-7 (net +3). The larger alternative test matrix and documentation prose were not carried forward. One redundant exception assertion was removed; an unexpected exception still fails the test. No new helpers or compatibility paths.

This is a behavior-neutral follow-up, not a second claim to fix the original bug. The relevant real-Gateway history is on the linked onboarding PR; this candidate's proof is the existing owner tests, real-browser E2Es, build, and checks. No appearance changes require new screenshots.

Focused commands:

node scripts/run-vitest.mjs ui/src/pages/model-setup
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/model-setup-activation-feedback.e2e.test.ts ui/src/e2e/model-setup-cancel.e2e.test.ts ui/src/e2e/model-setup-reconnect.e2e.test.ts

Keep terminal receipt classification with the first-run owner and replace the admission flag side channel with a local outcome. Preserve the recovery behavior landed in #139140 without changing Gateway or configuration contracts.
@clawsweeper

clawsweeper Bot commented Sep 7, 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.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Sep 7, 2026
@steipete
steipete marked this pull request as ready for review September 7, 2026 02:30
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 7, 2026
@clawsweeper

clawsweeper Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 10:36 PM ET / September 7, 2026, 02:36 UTC.

ClawSweeper review

What this changes

The Control UI passes setup wizard outcomes directly to the first-run recovery owner and represents rejected admission explicitly instead of carrying a separate flag.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-requested cleanup open. Current main retains the extra outcome translation, and the introduced changes preserve the existing recovery decisions without an actionable correctness finding.

Priority: P3
Reviewed head: 27135f769990d33fd26d31db2fc027df3092cb0d

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-level simplification with relevant existing coverage and no actionable correctness or security findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The provided MEMBER status exempts this internal cleanup from external-contributor proof. Its reported owner tests and browser suites exercise outcome handling; the diff introduces no material authority change requiring separate final-effect proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The provided MEMBER status exempts this internal cleanup from external-contributor proof. Its reported owner tests and browser suites exercise outcome handling; the diff introduces no material authority change requiring separate final-effect proof.
Evidence reviewed 7 items Introduced patch and current-main comparison: The pinned merge-base-to-head patch matches the supplied six-file introduction evidence. Comparing the four production files between the merge base and fetched main produced no differences: main still has the pre-refactor implementation.
Recovery classification remains equivalent: The recovery owner releases only cancellation, explicit non-admission, or rejection before promotion. Generic errors retain uncertainty; successful model recording still requires the pending activation and current ownership. The sole production caller now forwards the result directly.
Documented admission contract: The documentation distinguishes UNAVAILABLE with SETUP_ADMISSION_BUSY, which proves the operation never began, from generic errors and terminal failures that can follow writes. The unchanged error helper requires both codes; the runner normalizes this result only on its retained start request.
Findings None None.
Security None None.

How this fits together

Model Setup receives Gateway wizard results while users configure AI access. Its first-run recovery owner retains uncertain attempts, releases definitively rejected attempts, and records verified models before onboarding continues.

flowchart TD
  A[User starts model setup] --> B[Gateway setup wizard]
  B --> C[Browser wizard runner]
  C --> D[First-run recovery owner]
  D --> E[Retain uncertain attempt]
  D --> F[Release rejected attempt]
  D --> G[Record verified model]
  G --> H[Continue onboarding]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -5, Tests +3. Total -2 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 4 37 42 -5
Tests 2 10 7 +3
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 47 49 -2

Review metrics

None.

Technical review

Best possible solution:

Keep terminal recovery classification with the first-run owner while preserving exact receipt ownership and the distinction between non-admission and uncertain completion.

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

Not applicable: this PR proposes a behavior-preserving cleanup of an existing fix, and source inspection found no introduced failure to reproduce.

Is this the best way to solve the issue?

Yes. Moving the existing classification into its recovery owner removes a side channel without duplicating capability or changing persistence, protocol, or retry policy.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a bounded internal cleanup with no intended change to user-visible onboarding behavior.
  • 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: The provided MEMBER status exempts this internal cleanup from external-contributor proof. Its reported owner tests and browser suites exercise outcome handling; the diff introduces no material authority change requiring separate final-effect proof.

Label justifications:

  • P3: This is a bounded internal cleanup with no intended change to user-visible onboarding behavior.
  • 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 provided MEMBER status exempts this internal cleanup from external-contributor proof. Its reported owner tests and browser suites exercise outcome handling; the diff introduces no material authority change requiring separate final-effect proof.

Evidence

What I checked:

  • Introduced patch and current-main comparison: The pinned merge-base-to-head patch matches the supplied six-file introduction evidence. Comparing the four production files between the merge base and fetched main produced no differences: main still has the pre-refactor implementation. (ui/src/pages/model-setup/wizard-runner.ts:31, f9f4aa93646e)
  • Recovery classification remains equivalent: The recovery owner releases only cancellation, explicit non-admission, or rejection before promotion. Generic errors retain uncertainty; successful model recording still requires the pending activation and current ownership. The sole production caller now forwards the result directly. (ui/src/pages/model-setup/first-run-setup.ts:286, 27135f769990)
  • Documented admission contract: The documentation distinguishes UNAVAILABLE with SETUP_ADMISSION_BUSY, which proves the operation never began, from generic errors and terminal failures that can follow writes. The unchanged error helper requires both codes; the runner normalizes this result only on its retained start request. Public docs: docs/start/wizard-cli-reference.md. (docs/start/wizard-cli-reference.md:493, 27135f769990)
  • Existing recovery tests remain meaningful: Inspected cases distinguish busy start from busy next, generic failures from definitive rejection, and active receipts from replacements. The changed expiry test still checks synchronous notification, receipt removal, and absence of navigation; removing its not-to-throw wrapper does not hide exceptions. (ui/src/pages/model-setup/model-setup-activation.test.ts:547, 27135f769990)
  • Storage and authority boundaries preserved: The receipt serializer, authentication binding, deadline, exact-receipt deletion, connection ownership checks, and dispatch guards are unchanged. The local result variant neither alters the Gateway protocol nor materially transfers or broadens authority. (ui/src/pages/model-setup/first-run-activation-receipt.ts:98, 27135f769990)
  • Related merged work and routing history: The supplied GitHub context confirms fix(onboarding): keep Tauri setup recoverable and verify model results #139140 merged the earlier recovery fix. Current-main history also lists subsequent explicit-choice onboarding work and several earlier setup repairs by Peter Steinberger. This PR is a follow-up cleanup, not a replacement claim for the original fix. (ui/src/pages/model-setup/wizard-runner.ts, 74d720e8d27f)

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.

@steipete

steipete commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready verification for 27135f769990.

The final cleanup preserves the existing first-run recovery contract while deleting the admission side channel and page projection. Production net −5, tests net +3, no new test cases. The initial file-line lint failure was resolved by removing a redundant exception wrapper, not by weakening a guard or baseline.

  • Model Setup: 315/315 before and after.
  • Chromium activation-feedback, cancellation, and reconnect: 17/17.
  • UI build, final changed checks, and git diff --check: passed.
  • Fresh isolated Codex autoreview: no actionable P0–P2 findings.
  • Exact-head CI: 34076527463, successful for the head above.
  • Native OPENCLAW_TESTBOX=1 scripts/pr prepare-run 140655: passed using hosted exact-head gates; no rebase or additional push was needed.
  • ClawSweeper review: no findings and no pre-merge requests.

Commands used for local proof:

node scripts/run-vitest.mjs ui/src/pages/model-setup
OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=.artifacts/vitest-cache-first-run-e2e node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/model-setup-activation-feedback.e2e.test.ts ui/src/e2e/model-setup-cancel.e2e.test.ts ui/src/e2e/model-setup-reconnect.e2e.test.ts
node scripts/check-changed.mjs -- ui/src/pages/model-setup/first-run-setup.ts ui/src/pages/model-setup/model-setup-page.ts ui/src/pages/model-setup/state.ts ui/src/pages/model-setup/wizard-runner.ts ui/src/pages/model-setup/model-setup-activation.test.ts ui/src/pages/model-setup/wizard-runner.test.ts
pnpm ui:build

This is behavior-neutral with unchanged appearance and Gateway contracts. No new live-provider or screenshot claim is made; the current candidate has real-browser and owner-boundary test proof.

@steipete
steipete merged commit 68c589a into main Sep 7, 2026
178 checks passed
@steipete
steipete deleted the fix/first-run-outcome-owner-cleanup branch September 7, 2026 02:49
@steipete

steipete commented Sep 7, 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
Keep terminal receipt classification with the first-run owner and replace the admission flag side channel with a local outcome. Preserve the recovery behavior landed in openclaw#139140 without changing Gateway or configuration contracts.
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 maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

1 participant