Make local WSL setup deterministic - #559
Conversation
Replace the local setup path that exported/imported an existing Ubuntu distro with a clean, app-owned WSL install flow. Tighten preflight, cleanup, install-path validation, rollback, documentation, and regression coverage so setup has explicit success and failure conditions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Codex review: found issues before merge. Reviewed May 28, 2026, 12:14 PM ET / 16:14 UTC. Summary Reproducibility: no. high-confidence local reproduction was run in this read-only Linux review. Source inspection shows current main uses export/import while the PR hard-gates WSL 2.4.4 direct install, and the PR body covers only the happy-path Windows E2E runs. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land the direct clean-install path only after preserving an older-WSL fallback/default or explicitly approving and documenting the new WSL minimum with upgrade proof. Do we have a high-confidence way to reproduce the issue? No high-confidence local reproduction was run in this read-only Linux review. Source inspection shows current main uses export/import while the PR hard-gates WSL 2.4.4 direct install, and the PR body covers only the happy-path Windows E2E runs. Is this the best way to solve the issue? No, not yet: direct clean install is a maintainable direction for determinism, but the unconditional WSL 2.4.4 gate changes upgrade behavior without a fallback or explicit compatibility decision. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 6ca8484bc5b3. 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
|
|
ClawSweeper PR egg 🔥 Warming up: real-behavior proof passed; findings, security review, or rank-up moves are still in progress. Hatch commandComment Hatchability rules:
What is this egg doing here?
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Manual + automated validation completed after pulling in only the drain-refactor fix from #550 to unblock the latest gateway regression. Automated validation
Manual validation
Commit pushed: |
|
Landed in master via the integrated Inno installer stack on branch shanselman/inno-installer-plan (master now at 8edf4eb). Closing this source PR as absorbed. |


Summary
This PR makes local gateway setup deterministic by removing the hidden dependency on an existing local Ubuntu distro. Setup now creates a fresh app-owned WSL gateway distro directly from the configured Ubuntu release every run, and fails explicitly when the host WSL version or install path cannot support that clean-start contract.
What changed
wsl --export Ubuntu-24.04/wsl --importflow with direct named install:wsl --install --distribution <BaseDistro> --name <DistroName> --location <app-owned path> --no-launch --web-downloadBaseDistroas the Ubuntu release to install from a clean WSL baseline, not a local source distro to export.wsl --shutdownduring partial install cleanup when--unregistersucceedswsl --versiontell users to update WSL.Motivation
The previous setup path could be poisoned by a missing or corrupted local
Ubuntu-24.04distro because setup reused it as the export source. This PR makes setup predictable for users, support, and CI by always creating the gateway from a clean WSL install baseline and surfacing hard failures instead of falling back to hidden reuse paths.Validation
./build.ps1— passeddotnet test ./tests/OpenClaw.SetupEngine.Tests/OpenClaw.SetupEngine.Tests.csproj --no-restore --tl:off— passed, 181 testsdotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore --tl:off— passed, 2022 passed / 29 skippeddotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore --tl:off— passed, 843 testsOPENCLAW_RUN_E2E=1 dotnet test ./tests/OpenClaw.E2ETests/OpenClaw.E2ETests.csproj -r win-arm64 --tl:off— passed 3 consecutive runs, each 6 passed / 0 failed / 0 skippedReview notes
A Hanselman/adversarial review was run before finalizing. Follow-up fixes from that review are included: less disruptive partial cleanup, clearer old-WSL handling, and more robust install-path checks.