Repository navigation
fix: gateway controls preserve Linux PATH in WSL - #1227
Conversation
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, 7:16 PM ET / 23:16 UTC. ClawSweeper reviewWhat this changesThis PR sends WSL gateway start, stop, and restart scripts to Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open for normal collaborator and maintainer review. The focused change correctly moves the three gateway control verbs off the WSL argv path, but a real managed-distro smoke is still unavailable and the linked broad path-confusion report may include an unchanged Doctor command path. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — execution before step 1 Assertions:
How this fits togetherConnection-page and repair actions control an app-managed WSL gateway through a small command controller. The controller gives structured arguments and a script to flowchart LR
A[Connection and repair actions] --> B[Gateway control builder]
B --> C[WSL command runner]
C --> D[wsl.exe]
D --> E[Managed WSL gateway]
E --> F[Start stop or restart]
F --> G[Exit code and diagnostics]
Decision needed
Why: The PR explicitly links the report, but current source still constructs a Doctor Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the stdin-based control implementation, verify all three controls on a managed WSL gateway, and either retain the broader linked report for the Doctor path or explicitly scope it to control verbs before it closes. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main constructs a Is this the best way to solve the issue? Yes for the three control verbs: stdin is the documented maintainable route and preserves the existing structured command, timeout, and cancellation boundary. It is unclear whether this alone fully resolves the linked broader report because Doctor remains on the argv path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8ff0353919cf. 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
|
Closes #911
What Problem This Solves
Fixes an issue where users controlling the local gateway in WSL could have Linux shell variables such as
$PATHrewritten bywsl.exe, causing gateway start, stop, or restart commands to run with Windows path semantics.Why This Change Was Made
Gateway control scripts now run through
bash -sand are sent over stdin, whichwsl.exedoes not rewrite. The WSL command runner accepts optional stdin while preserving authoritative process exit/stderr results and existing cancellation and timeout behavior.User Impact
Local WSL gateway start, stop, and restart operations retain the intended Linux executable search path instead of inheriting a rewritten Windows
$PATH.Evidence
bash -s, keep$PATHin stdin, and pass the script throughIWslCommandRunner.afa4ed08b8555b0fc230df990d33f132a914f2b2; no unrelated paths are present.Change Type
Scope
winnodeValidation
dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --filter "FullyQualifiedName~WslGatewayControllerTests|FullyQualifiedName~StartupSetupStateTests|FullyQualifiedName~LocalAiGatewayProviderCoordinatorTests" --logger "console;verbosity=normal": 58 passed, 0 failed, 0 skipped..\build.ps1: passed; documentation validation and all five Debug build targets succeeded.dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --logger "console;verbosity=minimal": 3,813 passed, 0 failed, 32 skipped, 3,845 total.dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore --logger "console;verbosity=minimal": 2,712 passed, 0 failed, 0 skipped.A fresh-worktree Shared test invocation initially lacked
project.assets.json; the project was restored once, then the complete required build and both--no-restoresuites were rerun successfully.Real Behavior Proof
6bcb6c63.wsl.exe --list --verboseafter current-head automated validation.bash -sargv plus an stdin script containing the Linux$PATHprefix for start, stop, and restart.Yes/No/N/A): N/A.OpenClawGatewaydistro. No live gateway result is claimed.Security Impact
Yes/No): No.Yes/No): No.Yes/No): No.Yes/No): Yes.Yes/No): No.Yes, explain the risk and mitigation: the existing WSL process runner can now receive explicit stdin. Only the fixed gateway control script uses it; arguments remain structured, timeout and cancellation still kill the process tree, and broken-pipe failures preserve the process exit code and stderr.Compatibility and Migration
Yes/No): Yes.Yes/No): No.Yes/No): No.Review Conversations