Repository navigation
Conversation
Wait for stdout and stderr EOF on normal CommandRunner exits so trailing output is not lost. Keep the inherited-pipe escape bounded behind an explicit opt-in for WSL inspection commands. Co-authored-by: Copilot App <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 7, 2026, 6:06 PM ET / 22:06 UTC. ClawSweeper reviewWhat this changesPreserves trailing setup-command output by waiting for stream closure on normal exits, while retaining bounded waits for timeout cleanup and selected WSL inspections. Merge readiness⛔ Blocked before merge - 4 items remain This remains a useful candidate fix: current main and the latest release still cap normal output drains. No discrete introduced correctness defect was found, and the collaborator-authored work remains under active ownership. Priority: P2 Review scores
Verification
How this fits togetherThe setup engine runs Windows processes and WSL commands, then interprets their output to configure and verify the local gateway. Its command runner controls process timeouts, cancellation, and collection of stdout and stderr. flowchart TD
A[Setup and recovery steps] --> B[Windows or WSL command]
B --> C[Process exits or times out]
C --> D{Timeout or inspection escape?}
D -->|Yes| E[Bounded output drain]
D -->|No| F[Wait for stream closure or cancellation]
E --> G[Output and status returned to setup]
F --> G
Decision needed
Why: The native pool is maintainer-scheduled, and the supplied successful check lacks inspectable scenario results in this review. 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 the focused drain distinction, with native fresh-setup and existing-install recovery evidence establishing that complete output and responsive cancellation coexist without inherited-pipe stalls. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main can return when its drain budget expires before stdout and stderr reach EOF. This review did not execute a failing reproduction. Is this the best way to solve the issue? Yes, provisionally: explicit inspection escapes are a focused way to preserve normal output, but native setup and recovery evidence must establish that the selected callers cover the inherited-handle cases. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 88822d342567. 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 (1 earlier review cycle)
|
|
Superseded by #1361 (Preserve normal setup command output drains), rebuilt on current main with the current WSL UTF-8 behavior, the newer Windows-node inspection call site, and a source-compatible public API. Thank you @karkarl for the focused design and regression coverage; the replacement commit credits your contribution. |
Summary
Fixes #1194
CommandRunnerstill applied a universal post-exit drain cap, so a cleanly exited command could return before queued stdout or stderr callbacks delivered trailing JSON or success markers. This PR waits for both redirected streams to close on normal exits, preserves caller cancellation while waiting, and keeps bounded waits only for timeout cleanup or explicit WSL inspection calls that can inherit pipe handles.Closed PR #1207 had the right shape, but it was closed as an obsolete conflicting branch. This reapplies the narrow fix against current
main, including the current three-second inherited-pipe cap.Required proof pools
windows-wsl-gateway-e2e: setup WSL inspection command behavior changed; maintainer-scheduled real gateway setup proof should verify the product path before merge.Validation
$env:OPENCLAW_REPO_ROOT=(Get-Location).Path; .\build.ps1- passed, all builds succeeded.$env:OPENCLAW_REPO_ROOT=(Get-Location).Path; dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --no-restore --filter FullyQualifiedName~CommandRunnerTests- passed, 12/12.$env:OPENCLAW_REPO_ROOT=(Get-Location).Path; dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore- passed, 3937 passed, 32 skipped.$env:OPENCLAW_REPO_ROOT=(Get-Location).Path; $env:OPENCLAW_TRAY_DATA_DIR=Join-Path (Get-Location).Path '.tray-test-data'; dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore- passed, 2858/2858.Real behavior proof
RunAsync_DrainsHighVolumeStdoutAndStderrThroughTrailingMarkersemits 8,000 stdout lines and 8,000 stderr lines plus finalSTDOUT_MARKERandSTDERR_MARKER; current head captures all lines and both trailing markers.WaitForOutputDrainAsync_WaitsPastCommandDeadlineOnNormalExitproves normal exits no longer return just because the old drain cap or remaining command deadline elapsed.WaitForOutputDrainAsync_CancellationInterruptsNormalPostExitDrainproves caller cancellation remains honored while waiting for normal stream closure.RunAsync_ReturnsWhenDescendantKeepsOutputPipesOpennow usesallowInheritedPipeHandleEscape: trueand still returns within the bounded inherited-pipe wait.windows-wsl-gateway-e2eis not run locally; it is a maintainer-scheduled proof pool.MXC and
system.runwere not touched, so.\scripts\validate-mxc-e2e.ps1was not required.