Add WSL gateway dependency-recovery to setup wizard#804
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 24, 2026, 3:29 PM ET / 19:29 UTC. Summary Reproducibility: yes. from source inspection. Trigger a wizard error with a live server-side session, click Restart gateway, and have the WSL control command fail before stopping the gateway; the PR has already disconnected and can no longer send wizard.cancel. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep the WSL recovery UI, cancel the active wizard session before any restart disconnect, and require redacted runtime proof of terminal launch, restart, reconnect, and wizard re-entry. Do we have a high-confidence way to reproduce the issue? Yes, from source inspection. Trigger a wizard error with a live server-side session, click Restart gateway, and have the WSL control command fail before stopping the gateway; the PR has already disconnected and can no longer send wizard.cancel. Is this the best way to solve the issue? No, not yet. The recovery direction fits the setup flow, but the implementation should cancel the wizard session before detaching the client, and proof should show the real WSL terminal/restart/reconnect path. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2cae69ba6ca4. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
247beac to
b1fefc1
Compare
acd4475 to
66e5936
Compare
When the gateway config wizard (provider/model/OAuth onboarding) fails on an app-managed WSL gateway, the wizard used to dead-end on a generic error with no way forward. This adds in-product recovery: the gateway error is shown verbatim and selectable (so the user can copy any install command it reports), plus two actions: - Open terminal - drops into the WSL distro to run the fix - Restart gateway - restarts the distro, reconnects, and re-enters the config wizard where the user left off We don't parse the gateway error text; the gateway's wording is outside our control and can change. The recovery actions are gated purely on the gateway being an app-managed WSL distro we control (GatewayHostAccess.CanControlWslGateway plus a known DistroName). WSL helpers (WslCommandRunner, WslGatewayController, GatewayHostAccess, GatewayTerminalLauncher) move from OpenClaw.Tray.WinUI/Services into OpenClaw.Connection so the SetupEngine UI can consume them (history-preserving renames). Hardening (from a dual-model review): - Restart handler claims the operation generation and locks the UI synchronously before the first await, re-checking after each await, so a double-click can't fire a stale restart. - WslGatewayController only reports 'distro not registered' when enumeration definitively lacks it; an empty list (probe failure/timeout) fails open. - Gateway restart uses a 2-minute timeout for slow cold-distro restarts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Document that the wizard shows WSL recovery actions based on the managed gateway record and does not parse gateway error text. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
66e5936 to
6877f66
Compare
What & why
When the gateway config wizard (provider/model/OAuth onboarding) fails on an app-managed WSL gateway — typically because a required CLI/tool isn't installed in the distro — the wizard used to dead-end on a generic error with no way forward. This PR adds in-product recovery so the user can fix the problem and continue without leaving the app.
The wizard error state now offers:
We don't parse the gateway error text. The gateway's wording is outside our control and can change, so rather than guessing at "is this a missing dependency?" or extracting a command, we surface the message as-is and let the user decide. The recovery actions are gated purely on the gateway being an app-managed WSL distro we control (
GatewayHostAccess.CanControlWslGateway+ a knownDistroName), so they never appear for gateways we can't act on.Changes
GatewayRecoverypanel inWizardPage.xaml(Open terminal + Restart gateway) plus handlers inWizardPage.xaml.cs(MaybeShowGatewayRecovery, open-terminal / restart).ErrorTextis now selectable.WslCommandRunner,WslGatewayController,GatewayHostAccess,GatewayTerminalLaunchermove fromOpenClaw.Tray.WinUI/ServicesintoOpenClaw.Connectionso the SetupEngine UI can consume them (history-preserving renames).docs/ONBOARDING_WIZARD.mdnotes the recovery flow.Hardening (from a dual-model review)
WslGatewayControlleronly reports "distro not registered" when enumeration definitively lacks it; an empty list (probe failure/timeout) fails open so the real error surfaces.Validation
./build.ps1— ✅ all projects (ARM64, warnings-as-errors clean)OpenClaw.Shared.Tests— ✅ 2370 passed / 0 failed / 29 skippedOpenClaw.Tray.Tests— ✅ 1124 passed / 0 failedScreenshots
The
GatewayRecoverypanel in the wizard error state: the gateway error shown verbatim (selectable) with Open terminal and Restart gateway actions — only rendered for an app-managed WSL gateway. No parsed command box or generated help text.