Skip to content

fix(linux): keep first-run onboarding alive when the gateway restarts - #129502

Merged
steipete merged 3 commits into
mainfrom
codex/linux-tauri-live-onboarding-stress-20260825
Aug 25, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/linux-tauri-live-onboarding-stress-20260825

Conversation

@steipete

@steipete steipete commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where Linux desktop users lost first-run AI setup or guided onboarding whenever their Gateway restarted or stayed offline for 15 seconds. The app replaced the live onboarding page with its local stopped screen and later opened ordinary chat, silently skipping model verification or the remaining onboarding steps. An interrupted model activation could also be dispatched twice, accept the wrong replacement model, or fail to retry when the user selected Check again.

Why This Change Was Made

The native Linux watchdog now preserves the actual live WebView throughout a reconnect only while Model Setup or guided onboarding owns it, leaving ordinary dashboard reconnect behavior unchanged. The shared first-run setup owner records the exact model activation before dispatch, retains that intent only across the same Gateway client and agent, verifies the exact persisted model after reconnect, fences ambiguous duplicate activation, and rearms only on an explicit user retry.

User Impact

Linux onboarding now survives Gateway restarts, continues the remaining guided setup, and reliably reaches a working AI-backed chat. Failed or ambiguous activation remains visible and actionable without changing unrelated startup, update, or credential behavior.

AI-assisted: yes.

Evidence

  • Reproduced on a fresh real Linux/XFCE desktop with the actual native Tauri WebKit app, bundled CLI installer, user systemd Gateway, and a real organization OpenAI API key. Initial OpenAI model activation succeeded and opened guided onboarding.
  • Before the fix, both /settings/model-setup?firstRun=1 and /custodian?onboarding=1 were replaced by the stopped screen exactly 15 seconds after systemctl --user stop openclaw-gateway.service; restarting the Gateway incorrectly ended at /chat/main.
  • Exercised a real invalid OpenAI key: the provider returned HTTP 401 and the app retained an actionable authentication failure without proceeding.
  • Demonstrated failing owner-boundary regressions before each repair: explicit Check again did not activate newly discovered credentials; a committed activation reconnect routed to chat instead of onboarding; an unconfirmed reconnect dispatched the same activation twice; a different persisted model triggered another unsafe activation.
  • Focused UI owner and reconnect siblings: 51 tests passed across four files.
  • Real Linux canonical coherent Gateway/UI build and native Tauri cargo build --locked plus cargo test --locked --all-targets passed against the exact PR head: 121 tests passed and one intentionally ignored.
  • Repeated on a fresh real Blacksmith Linux desktop with actual systemd, Xvfb/Openbox, WebKitWebDriver, bundled CLI installer, and real OpenAI credentials. The healthy guided onboarding page, verified OpenAI model, and channel choices remained visible throughout a 27-second Gateway outage with an explicit reconnect banner; the unpatched app destroyed the page at 15 seconds.
  • Final independent native-desktop pass preserved the same onboarding WebView through an 18-second Gateway outage, recovered automatically, selected Talk to my agent, and received the real OpenAI assistant response LINUX_TAURI_FINAL_OK.
  • Repaired current-main CI defects without changing production code: non-isolated Vitest workers now clear process-global plugin metadata and stale reader callbacks between files, and a newly merged model-resolution test no longer mocks away the scoped metadata function it calls. The real current-main regression failed before deleting its redundant four-line mock and passes afterward; all eight model-resolution tests plus seven runner tests now pass, and the full project ownership audit reports zero missing or duplicated files.
  • Independent structured code review: clean, no accepted or actionable findings.
  • The native desktop/OpenAI proof and 121 Rust plus 51 UI tests cover identical production code; the only subsequent head changes are the independently reviewed test-infrastructure repairs above. Exact-head hosted CI is running.

Before: onboarding is destroyed after 15 seconds offline

Linux desktop before: onboarding is replaced by the stopped Gateway screen

After: verified AI onboarding remains alive while the Gateway reconnects

Linux desktop after: verified OpenAI onboarding remains visible with an actionable reconnect banner

@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui app: linux size: M maintainer Maintainer-authored PR labels Aug 25, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 25, 2026, 1:50 PM ET / 17:50 UTC.

ClawSweeper review

What this changes

Preserves Linux first-run Model Setup and guided onboarding across Gateway reconnects while preventing ambiguous model-activation retries.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked until real behavior proof is added - 3 items remain

Keep this PR open. The source repair is focused and addresses the current-main failure, but final exact-head Linux after-fix evidence is still required before merge.

Priority: P1
Reviewed head: 1580acabbac73a67e978c12c5b322315f80ad554

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch is focused and source-backed with useful regression coverage, but required after-fix Linux evidence is absent.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR says final exact-head Linux before/after screenshots and real verification/chat evidence will be added later; add redacted evidence before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR says final exact-head Linux before/after screenshots and real verification/chat evidence will be added later; add redacted evidence before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Current-main behavior: Current main always replaces a disconnected dashboard with a local recovery page and reloads the dashboard after recovery; the branch suppresses those navigations only for active first-run routes.
Activation ownership: The branch records activation intent before dispatch, retains it only for the same client and agent, verifies the exact model after a new hello, and clears it only for explicit retry.
Regression coverage: Added mounted-page tests cover reconnect-before-response, duplicate-activation fencing, model mismatch, and explicit retry; the Rust test limits WebView retention to the intended routes.
Findings None None.
Security None None.

How this fits together

The Linux desktop watchdog normally replaces an unreachable Gateway dashboard with a local recovery page. Model Setup detects and activates a model, verifies it, then proceeds to onboarding or chat.

flowchart LR
  A[Gateway connection] --> B[Linux desktop watchdog]
  B --> C{First-run onboarding active?}
  C -->|yes| D[Preserve live web view]
  C -->|no| E[Show recovery screen]
  D --> F[Model Setup owner]
  F --> G[Activate and verify model]
  G --> H[Guided onboarding or chat]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR says final exact-head Linux before/after screenshots and real verification/chat evidence will be added later; add redacted evidence before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The fix adds net production state to reconnect and activation flows; real Linux proof is needed to confirm the native watchdog and retained WebView recover together.
  • Complete next step (P2) - The branch already contains the bounded repair; contributor-supplied real behavior proof is the remaining merge gate.
Agent review details

Security

None.

PR surface

Source +31, Tests +244, Docs 0, Other +72. Total +347 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 2 44 13 +31
Tests 1 244 0 +244
Docs 1 1 1 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 78 6 +72
Total 5 367 20 +347

Review metrics

Metric Value Why it matters
Production versus regression coverage production +103 net, tests +244, docs net 0 The added state is narrowly tied to first-run reconnection and is accompanied by regression coverage for retry and mismatch paths.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Add redacted exact-head Linux evidence showing a Gateway restart, the same first-run page remaining active, then successful verification into onboarding or chat.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Add redacted exact-head Linux evidence showing a Gateway restart, the same first-run page remaining active, then successful verification into onboarding or chat.

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

Yes, from source: current main’s watchdog replaces the first-run dashboard during an outage and later reloads the normal dashboard, discarding the live setup state.

Is this the best way to solve the issue?

Yes. Retaining only explicitly marked first-run routes and requiring a replacement Gateway hello plus exact model verification is narrower than a generic reconnect fallback.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 1d526c5c0ef6.

Labels

Label changes:

  • add P1: A Gateway restart can silently abandon Linux first-run AI setup before the user reaches a working chat.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR says final exact-head Linux before/after screenshots and real verification/chat evidence will be added later; add redacted evidence before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P1: A Gateway restart can silently abandon Linux first-run AI setup before the user reaches a working chat.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR says final exact-head Linux before/after screenshots and real verification/chat evidence will be added later; add redacted evidence before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Current-main behavior: Current main always replaces a disconnected dashboard with a local recovery page and reloads the dashboard after recovery; the branch suppresses those navigations only for active first-run routes. (apps/linux/src-tauri/src/main.rs:541, 1d526c5c0ef6)
  • Activation ownership: The branch records activation intent before dispatch, retains it only for the same client and agent, verifies the exact model after a new hello, and clears it only for explicit retry. (ui/src/pages/model-setup/first-run-auto-setup.ts:91, 1580acabbac7)
  • Regression coverage: Added mounted-page tests cover reconnect-before-response, duplicate-activation fencing, model mismatch, and explicit retry; the Rust test limits WebView retention to the intended routes. (ui/src/pages/model-setup/model-setup-first-run.test.ts:500, 1580acabbac7)
  • History and routing: Peter Steinberger has recent and substantial history on both the Linux desktop watchdog and Model Setup reconnect flow. (apps/linux/src-tauri/src/main.rs:529, 1580acabbac7)
  • Release and proof status: No local release tag contains the proposed head, and the PR body says final exact-head screenshots and real verification/chat evidence will be added later. (1580acabbac7)

Likely related people:

  • steipete: Recent history covers the Linux watchdog, desktop lifecycle, and Model Setup reconnect behavior. (role: recent area contributor and Linux desktop feature owner; confidence: high; commits: 1580acabbac7, f6aa7c24f1cf, a1615cdfcf4d; files: apps/linux/src-tauri/src/main.rs, ui/src/pages/model-setup/first-run-auto-setup.ts)
  • Vyctor H. Brzezowski: Commit b431a23 maintained Model Setup visibility during AI-access checks. (role: recent adjacent UI contributor; confidence: medium; commits: b431a2300bd0; files: ui/src/pages/model-setup/model-setup-page.ts)
  • Vincent Koc: History shows prior first-run setup and activation-flow work in the affected UI area. (role: earlier Model Setup contributor; confidence: medium; commits: c489a2ddab2f, dea04651b9c2; files: ui/src/pages/model-setup/model-setup-page.ts, ui/src/pages/model-setup/model-setup-first-run.test.ts)

Rank-up moves

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

  • Add redacted exact-head Linux evidence for restart, retained onboarding, and successful verification.
  • Update the PR body afterward; if review does not refresh, ask a maintainer to comment @clawsweeper re-review.

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 force-pushed the codex/linux-tauri-live-onboarding-stress-20260825 branch 2 times, most recently from 8add964 to 32013bf Compare August 25, 2026 21:27
@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Aug 25, 2026
@steipete
steipete force-pushed the codex/linux-tauri-live-onboarding-stress-20260825 branch from 32013bf to 8653198 Compare August 25, 2026 21:50
@openclaw-barnacle openclaw-barnacle Bot removed the agents Agent runtime and tooling label Aug 25, 2026
@steipete
steipete merged commit 18fba50 into main Aug 25, 2026
198 of 204 checks passed
@steipete
steipete deleted the codex/linux-tauri-live-onboarding-stress-20260825 branch August 25, 2026 22:30
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 26, 2026
…openclaw#129502)

* fix(linux): preserve onboarding through gateway restarts

* refactor(ui): keep model setup below file-size limit

* test: isolate plugin metadata and register startup retry coverage
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 maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant