Repository navigation
fix(setup): let uninstall recover from absent WSL distro - #1348
Conversation
Legacy Windows-node context cleanup now checks the registered WSL distributions before querying the prior distro. This makes a rerun idempotent after OpenClawGateway-Dev has already been removed instead of failing the uninstall. Missing-distro diagnostics are also recognized across stdout and stderr.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 6, 2026, 9:30 PM ET / September 7, 2026, 01:30 UTC. ClawSweeper reviewWhat this changesThe PR checks registered WSL distributions before removing legacy Windows-node instructions during uninstall and recognizes missing-distribution errors from both output streams. Merge readiness⛔ Blocked before merge - 3 items remain This remains useful work absent from pinned main, with credible real WSL proof. One error-classification defect needs correction before merge. Priority: P2 Review scores
Verification
How this fits togetherThe setup engine installs Windows-node instructions into a WSL agent workspace and removes them during uninstall. Legacy installations without recorded workspace state require discovering the configured distribution and workspace first. flowchart TD
A[Uninstall request] --> B[Recorded workspace state]
B -->|Present| C[Clean recorded workspace]
B -->|Absent| D[Inspect WSL distributions]
D -->|Target absent| E[Finish legacy cleanup]
D -->|Target present| F[Discover and clean workspace]
D -->|Inspection failed| G[Report cleanup error]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep idempotent absent-distro cleanup while distinguishing confirmed missing executables from launch failures that leave the cleanup target unknown. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the review finding: a process-start Win32 access-denied exception receives the accepted prefix and causes legacy cleanup to return successfully. This was not executed during review. Is this the best way to solve the issue? Mostly yes: checking registration is a focused repair, but treating every process-start failure as conclusive absence contradicts the intended ambiguous-error behavior. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 89adfe2eadda. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Supersedes #1322 because the repository ruleset cannot attach the required GitHub Actions
CI Gatecheck to a fork PR after a maintainer updates its head. This branch contains the same contributor changes merged with currentmain.What Problem This Solves
Fixes an issue where users rerunning an uninstall would receive a failure after
OpenClawGateway-Devhad already been removed. Legacy Windows-node context cleanup attempted a distro-specific WSL command even though the configured distro was absent.Why This Change Was Made
The legacy cleanup path now checks
wsl --list --quietbefore it resolves the prior distro workspace. An absent distro short-circuits cleanup successfully, while an unavailable WSL listing remains an explicit failure. Missing-distro diagnostics are recognized from either process output stream to handle an unregister race after the registration check.An inspection failure is treated as "nothing to clean" only when WSL conclusively reports no installed distributions or
wsl.execannot be launched (process start failure). Ambiguous failures such as a timeout or access denied remain explicit uninstall errors, so a hung or failing WSL never silently skips legacy cleanup.User Impact
A repeated uninstall now completes when its dev WSL distro has already been unregistered. It does not attempt commands against an unrelated or missing distro. On hosts where WSL is not installed at all, uninstall also completes instead of failing, while genuinely ambiguous WSL failures still stop the uninstall with a clear error.
Evidence
EXIT=0after the target distro was already absent.Uninstalling: Inject Windows node context, followed byUninstall completed successfully in 0.8sandUNINSTALL COMPLETE.Change Type
Scope
winnodeRequired proof pools
windows-clean-installer-upgrade: uninstall behavior changed. Not verified on this maintainer-scheduled signed-artifact pool.wsl.exe. Now covered in-process byWindowsNodeContext_Rollback_SkipsLegacyCleanupWhenWslHasNoDistributionsandWindowsNodeContext_Rollback_SkipsLegacyCleanupWhenWslExeCannotStart(and the ambiguous-failure guardsWindowsNodeContext_Rollback_FailsWhenDistroInspectionIsAmbiguous/...TimesOut). Not a pool run.windows-wsl-gateway-e2e: WSL recovery behavior changed. Not verified on this maintainer-scheduled clean WSL pool.wsl.exeharness proof against the registeredOpenClawGateway-Devdistro. Not a pool run.Validation
./build.ps1: passed.dotnet build tests/OpenClaw.SetupEngine.Tests/OpenClaw.SetupEngine.Tests.csproj: passed.dotnet test tests/OpenClaw.SetupEngine.Tests/OpenClaw.SetupEngine.Tests.csproj --no-restore: 1039 passed, 0 failed (baseline 1035 atebc9f176plus 4 new rollback regression tests).dotnet test tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: 3905 passed, 32 skipped, 0 failed.dotnet test tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: 2833 passed, 0 failed.Real Behavior Proof
OpenClawGateway-Devdistro absent.ebc9f176.OpenClaw.Tray.WinUI.exewith-DevBuild, verifiedapp-identity.txtequalsdev, then ranOpenClaw.Tray.WinUI.exe --uninstall --confirm-destructive.0; the output traversedInject Windows node contextwithout a distro query and ended withUninstall completed successfully in 0.8sandUNINSTALL COMPLETE.N/A.8e89578e(throwaway harness outside the repo, realwsl.exe, dev runner logging visible):OpenClawGateway-Absent-Proof): exactly one realwsl.exe --list --quiet(exit 0, 235 ms), zero in-distro commands, no exception, harness printedABSENT-OK.OpenClawGateway-Dev):wsl.exe --list --quiet, in-distrogetent passwd "$(id -un)" | cut -d: -f6, then the stdin-fed rollback script (exit 0), thenExecuteAsyncrestore printingRESTORE=Success message=Windows node context injected, then a second rollback for idempotency (exit 0), harness printedREGISTERED-OK.wsl.exe -l -vstill listsOpenClawGateway-DevasRunning, version 2. No distro contents, tokens, or gateway records were read or published; Windows user and profile paths redacted.OpenClawGateway-Devis registered and running and hosts the live dev gateway; the CLI-level destructive-uninstall proof atebc9f176above remains the CLI-level evidence.Security Impact
NoNoNoNoNoCompatibility and Migration
YesNoNoReview Conversations