fix(onboarding): surface gateway wizard terminal-error status instead of silent complete - #332
Merged
shanselman merged 2 commits intoMay 13, 2026
Conversation
… of silent complete
Wizard.ApplyStep treated any `done:true` payload as success, ignoring `status` and `error` fields. Terminal-error responses (`{done:true, status:\"error\", error:\"...\"}`) collapsed to the \"complete\" lifecycle state, displaying the green-check Setup Complete screen with no buttons and silently dropping the gateway's error message. The user could only escape via the outer Next button, advancing through the rest of onboarding with a broken config.
This routes terminal-error payloads into the existing \"error\" lifecycle state, which already renders `errorMsg` with Retry/Skip controls. Same pattern as the five other transport-error call sites in the file.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
shanselman
pushed a commit
that referenced
this pull request
May 13, 2026
dotnet test --no-restore silently no-ops in a fresh worktree where the test bin/ doesn't exist yet (reports 'Build succeeded in 0.5s' then exit 0). Discovered shipping PR #332. Add a brief gotcha so future agents (and humans) running first-run validation in a new worktree don't get a false-green pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Symptom
During first-run onboarding, the gateway wizard can return a terminal-error payload:
{"done": true, "status": "error", "error": "Error: Please enter a valid URL (e.g. http://...)"}WizardPage.ApplyStepignored bothstatusanderrorand collapsed anydone:trueinto the"complete"lifecycle state. The user saw a deceptive green ✅ "Setup complete — click Next to continue" screen with no buttons and no error text — the gateway's error message was silently dropped on the floor.The user could only escape via the outer Next button, which advanced them through Permissions → Ready → Finish with a broken configuration. At Ready,
OnboardingWindow.OnWizardCompletethen observedsetupStillRequired=trueand silently chose not to open the Hub window, leaving the user staring at the desktop with only a tray icon and no UI — perceived as "the app crashed."Log evidence (Mike Harsh's session, 2026-05-13)
No exception, no error UI, no Hub launch afterward. Tray process stayed alive (verified PID
28224, started 09:13:47, still receiving NODE health events through 09:25). NoWerFault, no.NET Runtimeevent log entries.Fix
src/OpenClaw.Tray.WinUI/Onboarding/Pages/WizardPage.cs— thedone:truebranch ofApplyStepnow inspectsstatusand, when it equals"error", routes into the existing"error"lifecycle state with the server-suppliederrorstring (falling back to the existingOnboarding_Wizard_StepErrorlocalization key when the gateway sendsstatus:"error"with no message).The
"error"render branch already renders a❌title +errorMsgbody + Retry/Skip controls. No new lifecycle state, no new resource key, no gateway-side change. Pattern exactly matches the five othersetErrorMsg / setWizardState("error") / SaveState("error", …)triples already in the file.Deferred (filed separately by the coordinator)
OnboardingWindow.cs:644-653: whenfinishedFromReady && setupStillRequired, the window currently closes silently with no replacement UI. This is the perceived "tray crash" moment. Intentionally not included here to keep the diff narrow and the navigation surface untouched.wizard.backRPC, so the user cannot recover from a wrong branch (e.g. picking the wrong provider). The terminal-error wedge fixed here is the immediate cause of Mike's session; back-nav is the structural cause and warrants its own design pass.Tests
No unit-test harness exists for
WizardPage.ApplyStep— the method is bound to React-styleUseStatehooks inside theWinUIcomponent and is not directly testable. The parallelWizardStepParserservice is unit-tested (tests/OpenClaw.Tray.Tests/WizardStepParsingTests.cs) but is not invoked byApplyStep, so adding a parser-level test would exercise a different code path. Creating aWizardPageharness from scratch was explicitly scoped out of this fix; filing as a follow-up.Manual validation: the new branch was exercised under the same payload shape that produced Mike's wedge.
Validation per AGENTS.md (Reporting Standard, post-fix)
Recent baseline from PR #310 work was Shared 1455/0/25 and Tray 961/0/0; counts have grown on master since.
Scope note
Strictly orthogonal to PR #310 (uninstall) — branched off
master. No overlap withLocalGatewaySetup/, PS scripts, orinstaller.iss. Single file changed, ~12 lines added.