Skip to content

Fix onboarding wizard Back desynchronization - #1205

Merged
shanselman merged 3 commits into
mainfrom
karkarl-fix-onboarding-wizard-back
Aug 28, 2026
Merged

shanselman merged 3 commits into
mainfrom
karkarl-fix-onboarding-wizard-back

Conversation

@karkarl

@karkarl karkarl commented Aug 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • remove the Companion-local Back action and stale wizard payload replay from Gateway-driven onboarding
  • document the actual protocol boundary: there is no dedicated wizard.back RPC, while Gateway-provided __back and back options are in-band answers submitted through wizard.next and intentionally filtered by Companion
  • keep More options visible during slow wizard connect and start work so Restart onboard and Skip & exit remain available
  • preserve operation-generation and cancellation safety by rejecting superseded continuations, disposing stale connected clients, and preventing stale restart operations from starting another wizard
  • add regression coverage for the protocol wording, option filtering, startup recovery visibility, and stale-client cleanup ordering

Fixes #1172

Validation

Current head: 12addd59ec70c2b307d7adc7f59dc22c63958a76

  • ./build.ps1 - passed; documentation validation and Shared, Cli, WinNodeCli, SetupEngine, and WinUI builds succeeded
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore - passed: 3,812 passed, 32 skipped, 0 failed
  • focused wizard regression tests - passed: 2 passed, 0 failed
  • python .agents/skills/autoreview/scripts/autoreview --mode local - clean: no accepted or actionable findings
  • rubber-duck review - clean: no actionable correctness, race, lifecycle, or coverage findings
  • git diff --check - passed before commit
  • GitHub CI setup-connect, network-recovery, and revocation-recovery E2E jobs, repo hygiene, CodeQL, and static analysis - passed

The full local Tray suite is blocked by a reproducible pre-existing host-specific hang in unchanged code: BrowserProxyEndpointScopingTests.Diagnostics_NoOverride_TunnelWithoutBrowserProxyForward_DoesNotProbeTunnelLocalPlusTwo. A focused run of that unchanged test also hangs until the per-test blame timeout, while both changed wizard tests finish in under one second. Crabbox remote validation was unavailable because the Crabbox CLI is not installed on this controller.

GitHub CI ran the full Tray suite twice. Both runs passed 2,750 tests and failed only the unchanged flaky OpenClawChatDataProviderTests.AttachmentMetadata_ConcurrentSavesPreserveEveryCompletedSend test, once missing file-6.png and once missing file-5.png. The focused failing test passes locally, and its code path is outside this PR diff. The required test check remains red on that unrelated flake, so the PR is not currently merge-ready.

Real behavior proof

The current-head Debug/Dev executable was launched through the repository-supported Gateway-free preview path with isolated app data:

$env:OPENCLAW_SETUP_PREVIEW_PAGE='wizard'; ./run-app-local.ps1 -NoBuild -Isolated -AllowNonMain

Computer-use UI Automation and an independent WinUI Live Visual Tree capture confirmed:

  • Back controls: 0
  • More options: visible and expandable
  • Restart onboard: visible menu item
  • Skip & exit: visible menu item
  • Continue: visible on the active synthetic wizard step

The proof run used repository-supplied synthetic preview data only. Neither recovery action was invoked. The exact process was stopped by PID and its isolated data directory was removed. This proves current-head layout and recovery-menu availability, not a live Gateway wizard session.

@clawsweeper

clawsweeper Bot commented Aug 22, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement 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 Aug 22, 2026
@clawsweeper

clawsweeper Bot commented Aug 22, 2026 •

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 5:22 AM ET / 09:22 UTC.

ClawSweeper review

What this changes

The PR removes the setup wizard’s client-only Back control and cached-step replay, retains restart and exit recovery under More options, and prevents stale startup continuations from publishing a gateway client.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open. Current main still contains the client-local Back replay, while this active collaborator-authored PR is the concrete candidate fix for #1172; a maintainer should confirm the intentional removal of Back as the protocol-safe UX.

Priority: P2
Reviewed head: f17db8793ab93457fd921a4da923c348335b8277
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is focused and source-supported, with visible UI evidence, while its intentional compatibility tradeoff requires maintainer acceptance.
Proof confidence 🌊 off-meta tidepool Not applicable: The collaborator-authored PR is exempt from the external-contributor proof gate; the supplied synthetic WinUI screenshot directly shows Back absent and both recovery choices, but does not test a live Gateway session.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The collaborator-authored PR is exempt from the external-contributor proof gate; the supplied synthetic WinUI screenshot directly shows Back absent and both recovery choices, but does not test a live Gateway session.
Evidence reviewed 7 items Current main retains the reported defect: At the reviewed main base, each rendered step is saved in local history and the Back handler re-applies that local payload without a Gateway request.
Introduced fix removes the unsafe local path: The PR head has no Back button in the wizard layout, and its startup path rejects and disposes a client that completes after a newer operation supersedes it.
Repository protocol boundary: The current onboarding documentation defines Gateway-owned steps through wizard.start and wizard.next and documents that there is no dedicated wizard.back RPC; the shared client documents the supported wizard request family.
Findings None None.
Security None None.

How this fits together

The Windows setup wizard renders steps owned by a Gateway onboarding session and sends selected answers back through wizard RPCs. Its controls must reflect the Gateway’s current session so a local screen cannot submit an answer for an obsolete step.

flowchart LR
A[User starts onboarding] --> B[Windows setup wizard]
B --> C[Gateway-owned wizard session]
C --> D[Current step payload]
D --> B
B --> E[Continue or recovery action]
E --> C
Loading

Decision needed

Question Recommendation
Should Gateway-driven onboarding intentionally remain without Back until the Gateway exposes an authoritative rewind operation? Accept authoritative-only navigation: Land the PR with restart and exit as the recovery paths, and require a Gateway-owned rewind contract before restoring Back.

Why: The patch correctly removes a client-only state rewind, but accepting the resulting loss of backward navigation is a user-experience and protocol-contract choice that source review cannot make.

Before merge

  • Resolve merge risk (P1) - Merging deliberately removes an existing navigation affordance: users who need to revisit a prior choice must restart onboarding or exit, until the Gateway offers an authoritative rewind contract.
  • Resolve merge risk (P1) - The supplied screenshot verifies the rendered controls but does not exercise a live Gateway session, a restart, or an in-flight cancellation sequence.
  • Complete next step (P2) - A maintainer must accept the deliberate navigation compatibility tradeoff before this collaborator-authored fix can land.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Changed surface 4 files, 90 added, 32 removed The patch stays focused on one wizard layout/controller path, its documentation, and regression coverage.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #1172
Summary: This PR directly addresses the canonical report’s client-local Back replay and remains an unmerged fix candidate.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Accept the safe navigation change (recommended)
    Merge with Back unavailable and document restart or exit as the supported recovery paths until Gateway exposes server-owned rewind semantics.
  2. Pause for an authoritative rewind contract
    Keep the PR open only if maintainers want backward navigation now and will define the Gateway RPC and end-to-end compatibility behavior.

Technical review

Best possible solution:

Keep local navigation authoritative-only: retain restart and exit recovery now, and add Back only with a documented Gateway-side rewind operation plus end-to-end session-state proof.

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

Yes, at source level: current main pushes Gateway payloads into local history and Back re-renders one without sending a Gateway operation. This review did not execute a live Gateway-session reproduction.

Is this the best way to solve the issue?

Yes, conditionally: removing a client-only rewind is the narrowest safe repair under the documented protocol, provided maintainers accept restart and exit as the interim recovery UX.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 309299b8f17b.

Labels

Label changes:

  • 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 collaborator-authored PR is exempt from the external-contributor proof gate; the supplied synthetic WinUI screenshot directly shows Back absent and both recovery choices, but does not test a live Gateway session.
  • remove rating: 🦞 diamond lobster: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: needs maintainer proof decision: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This repairs a bounded onboarding session-state inconsistency without evidence of an emergency outage or data loss.
  • merge-risk: 🚨 compatibility: Removing Back intentionally changes the recovery path available to existing onboarding users.
  • 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 collaborator-authored PR is exempt from the external-contributor proof gate; the supplied synthetic WinUI screenshot directly shows Back absent and both recovery choices, but does not test a live Gateway session.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The collaborator-authored PR is exempt from the external-contributor proof gate; the supplied synthetic WinUI screenshot directly shows Back absent and both recovery choices, but does not test a live Gateway session.

Evidence

What I checked:

Likely related people:

  • shanselman: Authored the current branch’s startup-recovery and protocol correction, and recent history shows repeated ownership of wizard recovery work. (role: recent onboarding recovery contributor; confidence: high; commits: 12addd59ec70, 01faa6419b42; files: src/OpenClaw.SetupEngine.UI/Pages/WizardPage.xaml.cs, docs/ONBOARDING_WIZARD.md)
  • karkarl: Authored the initial corrective commit and prior history records related wizard UX work. (role: wizard UX contributor; confidence: high; commits: 4bbadb0b14bb, 87634727b65b; files: src/OpenClaw.SetupEngine.UI/Pages/WizardPage.xaml, src/OpenClaw.SetupEngine.UI/Pages/WizardPage.xaml.cs)
  • Peter Steinberger: History attributes the original Windows Gateway onboarding wizard implementation to this contributor. (role: original feature contributor; confidence: medium; commits: adcb4c378f90; files: src/OpenClaw.SetupEngine.UI/Pages/WizardPage.xaml.cs)

Rank-up moves

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

  • Record maintainer acceptance that Back remains unavailable until a Gateway-owned rewind contract exists.

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 (5 earlier review cycles)
  • reviewed 2026-08-22T09:47:22.617Z sha 4bbadb0 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-27T21:40:20.532Z sha 4bbadb0 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-28T06:33:32.136Z sha 4bbadb0 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-28T07:49:46.973Z sha 12addd5 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-28T08:20:45.045Z sha 12addd5 :: needs real behavior proof before merge. :: none

@TheAngryPit

Copy link
Copy Markdown
Contributor

Exact-head validation for 4bbadb0b14bbf128ea8c273fab8e06d901a5a42b against base ccd64bbb7d687d9929091109c8d722ad9ba962d9 is now complete.

Validation

  • Repository dependency preflight: PASS; npm lockfile matched and lifecycle scripts remained disabled.
  • Supported Debug/Dev build: PASS for docs validation, Shared, Cli, WinNodeCli, SetupEngine, and WinUI.
  • Focused WizardBack_IsUnavailableWithoutAuthoritativeGatewayRewind: 1 passed, 0 failed.
  • Full Shared suite: 3,812 passed, 32 skipped, 0 failed.
  • Full Tray suite: 2,704 passed, 0 skipped, 0 failed.
  • git diff --check: PASS; exact-head checkout remained clean.
  • Current GitHub checks: terminal green (13 pass, 8 intentional skips, 0 failed/pending); PR remains MERGEABLE/CLEAN at the same head/base.

Real behavior proof

The exact-head Debug/Dev executable was launched through the repository-supported, Gateway-free OPENCLAW_SETUP_PREVIEW_PAGE=wizard path with dedicated app data. The rendered WinUI window was inspected independently through Windows UI Automation; only More options was opened, and neither recovery action was invoked.

  • Back: 0 before and after opening the menu
  • More options: 1 visible control
  • Restart onboard: 1 visible menu item
  • Skip & exit: 1 visible menu item

The capture-time UIA record binds the source head/base and executable SHA-256 and passes all four assertions. The screenshot contains repository-supplied synthetic preview data only and was cropped to the app window.

Exact-head wizard preview with Back absent and both recovery actions visible

The screenshot is hosted from immutable evidence commit 2d881d0a.

Artifact hashes:

  • UIA JSON: 4C9DF16ACD3D7874BE98D44317E67CA7DCFF457CB10A597248215E4AB2F4FD0D
  • Screenshot: DFD76A64713B367FD1D7CF1C2AB9FB74D9954F588256430432ACC666FF8E7528
  • Focused TRX: 34B0680C3B3969D987B74BEAE0EE57B116FA018591C6758427038F1F05169F7C
  • Shared TRX: E21EC700EB4DA5E74A220BE1CC491A0CAC5C0823006D142156A12AE4B14D3320
  • Tray TRX: 0C0709C934B04E3B9035C03D175679EF51298FA8E7613E178C992F88695E710F

Cleanup was exact-PID and verified; no Gateway/WSL distro, production Companion, settings, credentials, or pairings were used or changed.

Proof boundary: runtime_proven for the exact-head Debug/Dev wizard preview layout and recovery-menu availability. This does not claim a live Gateway wizard session or downstream execution of either recovery action.

@clawsweeper re-review

@TheAngryPit

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@TheAngryPit

Copy link
Copy Markdown
Contributor

@karkarl The exact-head build, full test, UI Automation, and sanitized visual proof are published above and address both remaining validation items. This account has READ permission only, so ClawSweeper cannot accept our re-review command. Could you please post @clawsweeper re-review and, if the evidence looks good, mark the PR ready for review?

@karkarl
karkarl marked this pull request as ready for review August 27, 2026 21:34
@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient Contributor real behavior proof is sufficient. labels Aug 27, 2026
@karkarl

karkarl commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator Author

Adversarial release review

A dual-model Opus + Codex review examined the current onboarding Back-navigation fix.

Reviewed SHA: 4bbadb0b

Verdict: READY TO MERGE with 96% merge confidence.

No critical or high-severity findings, release blockers, or regressions were found. The change removes the unsafe client-only cached-payload rewind while preserving restart, skip, error, and finalization recovery. GitHub reports the PR clean, and all reported checks are green or intentionally skipped, including tests, setup and recovery E2E shards, x64 and ARM64 builds, repo hygiene, and CodeQL.

Two non-blocking observations remain:

  1. Initial connect/start keeps in-page More options hidden until a bounded timeout or error. The window can still be closed.
  2. The pre-existing ExpandMoreOptionsAsync path can retain old title/message state when a __more response changes the step ID.

Neither observation is introduced as a release-blocking regression by this PR.

@shanselman shanselman added the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Aug 28, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. and removed 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 Aug 28, 2026
@shanselman

Copy link
Copy Markdown
Collaborator

@karkarl Karen, I added two corrections on top of your focused Back-removal fix at 12addd59.

First, the protocol wording now distinguishes the missing dedicated wizard.back RPC from the Gateway's actual in-band navigation model. A Gateway may provide __back or back as an option value, and a client that exposes it submits that answer through wizard.next. Companion intentionally filters those values because its removed Back button did not submit them. It only replayed an older local payload, which could disagree with the authoritative Gateway session.

Second, removing local Back made More options the only in-page recovery path, so it now remains available while the initial Gateway connection and wizard.start are slow. Making that menu active during startup exposed an async race that the patch also closes: each restart or skip advances the operation generation, superseded connects are rejected and disposed before publication, and stale restart continuations cannot start another wizard.

The new tests pin both the protocol boundary and the startup generation/disposal ordering. Current-head UI proof shows no Back control and an expandable More options menu containing Restart onboard and Skip & exit. Build, 3,812 Shared tests, both focused wizard tests, rubber-duck review, and Codex autoreview are clean. The remaining full Tray gate is running in GitHub CI because this host reproducibly hangs in an unchanged browser-proxy diagnostics test.

@clawsweeper clawsweeper Bot removed the proof: sufficient Contributor real behavior proof is sufficient. label Aug 28, 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. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. labels Aug 28, 2026
@shanselman
shanselman merged commit 8651827 into main Aug 28, 2026
24 checks passed
@shanselman
shanselman deleted the karkarl-fix-onboarding-wizard-back branch August 28, 2026 09:37
@shanselman shanselman removed the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: onboarding Back rewinds Companion UI but not Gateway wizard session

3 participants