Repository navigation
fix: preserve Core updates across restart timeouts - #1231
Conversation
Preserve ambiguous WSL timeout and launch outcomes through automatic gateway repair so detached Core updates are not killed by forced distro termination. Definitive failures still use the existing cold-restart recovery path. Co-authored-by: TheAngryPit <[email protected]> Co-authored-by: Copilot App <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 9:17 PM ET / August 26, 2026, 01:17 UTC. ClawSweeper reviewWhat this changesThe branch marks WSL restart timeouts and launch failures as indeterminate so automatic local-gateway repair skips distro termination while retaining cold restart for definitive failures. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open. This collaborator-authored replacement is a focused fix for behavior still present on current main, with no blocking correctness finding in the proposed patch. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — execution before step 1 Assertions:
How this fits togetherThe tray app invokes WSL to restart its managed local gateway, then uses the result in automatic repair. The repair path either reports an uncertain outcome safely or terminates and cold-restarts the distro after a confirmed failure. flowchart LR
A[Gateway repair request] --> B[WSL command runner]
B --> C[Restart outcome]
C -->|Success| D[Gateway available]
C -->|Indeterminate| E[Report failure without termination]
C -->|Definitive failure| F[Terminate distro]
F --> G[Cold restart]
Before merge
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 indeterminate outcome propagation explicit, avoid destructive escalation for uncertain completion, and retain the existing cold-restart path for confirmed failures. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible. Current main escalates an unsuccessful restart directly to forced termination, while the branch's focused tests construct timeout and indeterminate results and assert zero termination calls. Is this the best way to solve the issue? Yes. Carrying an explicit indeterminate outcome to the sole repair escalation point is narrower and safer than inferring timeout state from an exit code or disabling cold restart for definitive failures. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c446f34882af. LabelsLabel changes:
Label justifications:
EvidenceWhat 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 #1181 because the contributor branch cannot be updated after
mainchanged a workflow file and the available OAuth token lacks workflow scope.This app-owned replacement preserves the final validated implementation from source commit
3aebd2fewhile rebasing it cleanly onto currentmain. Original design, investigation, and contribution credit belong to @TheAngryPit; the replacement commit also retains co-author attribution.What Problem This Solves
Automatic gateway repair previously treated a 30-second in-distro restart timeout as a definitive failure and force-terminated the WSL distro. That could kill a supported detached OpenClaw Core updater that was still running.
The WSL runner now carries explicit timeout and indeterminate outcome signals through the gateway controller. Automatic repair fails closed for ambiguous outcomes and skips destructive distro termination. Definitive non-timeout failures retain terminate plus cold restart.
The existing #1227 bash-stdin behavior is preserved and strengthened: stdin closure remains in
finally, sobash -sreceives EOF even when the write path fails.Validation
dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --filter "FullyQualifiedName~WslGatewayControllerTests": 13 passed, 0 failed, 0 skipped..\build.ps1: all 5 projects built; documentation validation passed for 46 files.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore: 3,813 passed, 0 failed, 32 intentional integration/environment skips.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore: 2,722 passed, 0 failed, 0 skipped.git diff --check: clean.3aebd2febefore commit.Real behavior proof
Current-head proof used the production
WslExeCommandRunneragainst Ubuntu on WSL 2 with read-only commands only. No terminate, restart, update, or gateway mutation command was invoked.Focused tests prove the consumption side of those outcomes:
OperationCanceledExceptionis propagated, with zero termination calls.Not verified / blocked: no destructive real-gateway outage was induced because proof was intentionally constrained to safe read-only WSL behavior.