Repository navigation
Conversation
Setup Capabilities called ReadToEnd() before WaitForExit(5000), so a hung or pipe-blocked tailscale.exe never reached the timeout. Wait for the child first, drain leftover stdout, and kill the process tree when either step times out. Signed-off-by: Sebastien Tardif <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed September 3, 2026, 1:39 AM ET / 05:39 UTC. ClawSweeper reviewWhat this changesThe PR replaces the setup Capabilities page’s unbounded Tailscale status-output read with a bounded process-output helper and focused tests. Merge readiness⛔ Blocked before merge - 5 items remain This PR remains necessary because current main still performs the unbounded read, but it should not merge as written: its timeout path exceeds the claimed five-second bound. A collaborator’s explicitly maintained replacement, #1296, preserves the fix and addresses that defect with Windows proof; repository policy keeps this PR open until the replacement lands. Priority: P2 Review scores
Verification
How this fits togetherThe setup Capabilities page runs the local Windows Tailscale status command to determine connection guidance. Its parsed result updates the setup UI and configuration preview. flowchart LR
A[Capabilities page] --> B[Tailscale status command]
B --> C[Bounded output helper]
C --> D[Status parser]
D --> E[Setup guidance]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the maintained replacement with one deadline across exit, drain, and cleanup, then close this original branch as superseded. Do we have a high-confidence way to reproduce the issue? Yes, from source. A process can consume the configured exit timeout and then receive additional drain and cleanup time, exceeding the stated deadline. Is this the best way to solve the issue? No. The maintained replacement applies one deadline across exit, drain, and cleanup, avoiding this branch’s extra grace periods. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bd7702c5149a. LabelsLabel 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
HistoryReview history (2 earlier review cycles) |
|
Maintainer replacement: #1296. The original contributor branch could not accept the required current-main merge because the maintainer OAuth token lacks workflow scope. The replacement preserves this PR's commit, merges current origin/main without rebase or force, and adds the one-deadline repair, Windows hung-process proof, full validation, rubber-duck review, and clean autoreview at commit 19edb7d. No merge was performed. |
|
Superseded on current main. #1296 landed |
|
Superseded by #1296 on main. |
What Problem This Solves
Fixes an issue where users turning on Tailscale during Companion setup would freeze the Capabilities page when
tailscale.exe status --jsonhung or left stdout open. The 5 second wait never ran, because the UI blocked onStandardOutput.ReadToEnd()first. Setup then sat on "Checking Windows Tailscale" until the child exited or the operator killed the wizard.Why This Change Was Made
The setup Tailscale status probe now waits for the child first, then drains leftover stdout with the remaining budget, and kills the process tree if either step times out. The 5 second bound is unchanged. This does not change Tailscale Serve install or the later preflight step that already uses
CommandRunner.User Impact
Operators can toggle Tailscale on the setup Capabilities page without the wizard hanging when the Windows Tailscale CLI is stuck. A failed or timed-out probe still shows that Windows Tailscale must be installed and signed in.
Evidence
Live
dotnet runagainst a child that never exits (sleep 20), using the same ReadToEnd-before-WaitForExit order as setup, then the WaitForExit-first plus kill-tree order this patch uses:Setup now calls
BoundedProcessOutput.ReadfromRefreshWindowsTailscaleStatusAsyncinstead ofReadToEnd()beforeWaitForExit(5000).Change Type
Scope
Required proof pools
none: the hang is the setup Tailscale child-process wait/read. A hung child on this host is enough. No installer, WSL, or interactive WinUI host is required.Validation
dotnet test ./tests/OpenClaw.SetupEngine.Tests/OpenClaw.SetupEngine.Tests.csproj --filter FullyQualifiedName~BoundedProcessOutputTestsWaiton stdout first):AwaitRedirectedOutput_ReturnsNullWhenStdoutNeverClosesfailed after 3.19s (Assert.Samehelper stillRunning)dotnet format --verify-no-changeson the new helper and tests./build.ps1were not run on this macOS hostReal behavior proof
Behavior or issue addressed: Setup Capabilities Tailscale probe blocked forever on
ReadToEnd()soWaitForExit(5000)never ran whentailscale.exehung or kept stdout open.Real environment tested: macOS 26.6.2, Darwin, Node v26.7.0, .NET 10.0.400, branch
fix/f002-tailscale-read-timeoutatd92edb7c, invoked withdotnet runfrom/tmp/f002-tailscale-bound-proof.Exact steps or command run after this patch:
cd /tmp/f002-tailscale-bound-proof dotnet runEvidence after fix: terminal output from the patched wait order:
Observed result after fix: WaitForExit returned in 431ms, the hung child was killed, and the caller continued. The old ReadToEnd path was still waiting at 1505ms with the child alive.
What was not tested: Interactive Setup wizard on a Windows host against a real hung
tailscale.exe.Security Impact
No)No)No)No)No)The probe still launches the same
tailscale.exe status --jsoncommand. Only the wait and kill-on-timeout behavior changed.Compatibility and Migration
Yes)No)No)Review Conversations
Related: introduced in #967. #1168 bounds a different keepalive command-line drain and does not touch this setup probe.