fix(cli): handle stdout/stderr stream errors in execFileUtf8Tail#100850
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 6, 2026, 11:06 AM ET / 15:06 UTC. Summary PR surface: Source +5, Tests +50, Other +60. Total +115 across 3 files. Reproducibility: yes. from source inspection: Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Land the focused helper-level stream error handling after normal maintainer review; keep adjacent subprocess helper hardening PRs separate unless maintainers decide to batch them. Do we have a high-confidence way to reproduce the issue? Yes from source inspection: Is this the best way to solve the issue? Yes. Handling the error in AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fbf574ad9db2. Label changesLabel justifications:
Evidence reviewedPR surface: Source +5, Tests +50, Other +60. Total +115 across 3 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
3d0f7fc to
79dcc46
Compare
|
Maintainer repair is land-ready on exact head
No docs or changelog change is required for this narrow internal CLI reliability fix. |
|
Merged via squash.
|
…nclaw#100850) * fix(cli): handle stdout/stderr stream errors in execFileUtf8Tail * chore(proof): add real behavior proof for logs-cli runtime stream errors * chore(proof): fix promise executor lint in logs-cli proof * fix(cli): terminate log tail children on stream errors --------- Co-authored-by: Vincent Koc <[email protected]>
…nclaw#100850) * fix(cli): handle stdout/stderr stream errors in execFileUtf8Tail * chore(proof): add real behavior proof for logs-cli runtime stream errors * chore(proof): fix promise executor lint in logs-cli proof * fix(cli): terminate log tail children on stream errors --------- Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
execFileUtf8Tailinsrc/cli/logs-cli.runtime.tsspawns a subprocess and reads stdout/stderr, but only attaches"data"listeners. If either stream emits an"error"event, it is unhandled and can crash the CLI log-tail command.Why This Change Was Made
Added
"error"listeners tochild.stdoutandchild.stderrthat resolve the promise with a failed result, reusing the existingsettledguard. The sharedresolveWithErrorhelper also replaces the duplicate child-process error handler.User Impact
openclaw logsand other CLI flows that tail subprocess output now fail gracefully with an error message instead of crashing on stream errors.Evidence
Regression tests:
pnpm test src/cli/logs-cli.runtime.test.tsReal behavior proof: