fix(setup): avoid false failure while WSL is still starting - #1106
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 6:47 PM ET / 22:47 UTC. ClawSweeper reviewWhat this changesThe PR gives post-install WSL2 version verification up to one minute to settle and adds regression coverage that asserts this timeout. Merge readinessKeep open. The focused patch correctly raises only fresh-install WSL version verification from 15 seconds to one minute, but the submitted E2E summary does not directly demonstrate a delayed 15-to-60-second version query recovering on the PR head; direct current-head proof is still needed before merge. Priority: P2 Review scores
Verification
How this fits togetherThe setup engine creates an app-owned WSL distribution for a local gateway, then validates it before provisioning continues. A failed validation triggers cleanup, so this timeout determines whether a slow but valid WSL installation proceeds or rolls back. flowchart LR
Setup[Gateway setup] --> Install[Install WSL distribution]
Install --> Discover[Discover distribution]
Discover --> Verify[Verify WSL2 version]
Verify -->|verified| Provision[Provision gateway]
Verify -->|timeout or invalid| Rollback[Rollback setup]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Attach redacted current-head Windows setup evidence showing the post-install version query completes after the former 15-second limit and the setup proceeds without rollback. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible. Current main passes a 15-second timeout to the fresh distro's verbose version query, and the command runner kills a process when that timeout expires; a host taking longer follows the verification failure path. Is this the best way to solve the issue? Yes. The one-minute allowance is narrowly scoped to post-install version verification, preserves the remaining command timeouts, and has focused coverage for the intended boundary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d2de6150753b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
What Problem This Solves
Fixes an issue where fresh gateway setup could fail and roll back after WSL installation when the WSL service took more than 15 seconds to report the new distro version. This intermittently failed unrelated pull requests in the revocation-recovery E2E shard.
Why This Change Was Made
The failing run showed
wsl.exe --installcompleting successfully andwsl.exe --list --quietfinding the new distro, followed bywsl.exe --list --verbosetiming out at 15.013 seconds. The post-install version verification now allows up to one minute for WSL to settle. Other WSL command timeouts and setup behavior are unchanged.User Impact
Gateway setup is less likely to report a false failure and remove a valid newly installed distro on slower Windows hosts or hosted runners.
Evidence
cb329a76.Change Type
Scope
winnodeValidation
./build.ps1: passeddotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj: 3,399 passed, 32 skippeddotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj: 2,053 passeddotnet test ./tests/OpenClaw.SetupEngine.Tests/OpenClaw.SetupEngine.Tests.csproj: 704 passeddotnet build ./tests/OpenClaw.E2ETests/OpenClaw.E2ETests.csproj -c Debug -r win-x64: passeddotnet test ./tests/OpenClaw.E2ETests/OpenClaw.E2ETests.csproj --no-build -c Debug -r win-x64 --filter "FullyQualifiedName~OpenClaw.E2ETests.Setup.RevocationAndRecoveryTests": 1 passedThe fresh worktree initially lacked NuGet assets for
--no-restoretest invocations. The test projects were rerun with restore and executed the non-zero counts above.Real Behavior Proof
cb329a76OpenClaw.E2ETests, setOPENCLAW_RUN_E2E=1, then ranFullyQualifiedName~OpenClaw.E2ETests.Setup.RevocationAndRecoveryTestsRealGateway_DeviceRemoval_RecoversThroughSharedTokenReconnectpassedYes/No/N/A): N/ASecurity Impact
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): NoYes, explain the risk and mitigation: N/ACompatibility and Migration
Yes/No): YesYes/No): NoYes/No): NoReview Conversations