fix(agents): suppress unhandled stdout/stderr stream errors in waitForChildProcess#100522
Conversation
|
Rebased onto latest Combined test run covering all five re-submitted stream-error fixes: Results:
Total: 49 tests passed across 4 Vitest shards in ~45s. |
|
Codex review: stale review; fresh review needed. Summary Next step Review history (4 earlier review cycles)
|
|
@clawsweeper re-review Added a real behavior proof script per the review feedback:
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review All CI checks are now green:
Proof script and regression tests are included in the PR body. Ready for another look. |
5ad6722 to
fa99a56
Compare
189710e to
a23eb4e
Compare
|
@clawsweeper re-review Replaced the proof scripts with real behavior proofs that exercise actual production code paths and emit real stream error events (or trigger a real EISDIR filesystem error for transcripts). All proofs pass locally; PR bodies are updated with commands and output. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
c7905a4 to
5325e23
Compare
|
Land-ready verification completed on exact head
This is the canonical repair and is ready for the native prepare/merge gates. |
|
Merged via squash.
|
…rChildProcess (openclaw#100522) * fix(agents): suppress unhandled stdout/stderr stream errors in waitForChildProcess * proof(agents): add real behavior proof script for child-process stream error catch * test(agents): drop synthetic child-process proof wrapper * proof(agents): replace wrapper with real child-process stream error proof * style: apply oxfmt to changed files * test(agents): drop synthetic child-process proof wrapper --------- Co-authored-by: Vincent Koc <[email protected]>
…rChildProcess (openclaw#100522) * fix(agents): suppress unhandled stdout/stderr stream errors in waitForChildProcess * proof(agents): add real behavior proof script for child-process stream error catch * test(agents): drop synthetic child-process proof wrapper * proof(agents): replace wrapper with real child-process stream error proof * style: apply oxfmt to changed files * test(agents): drop synthetic child-process proof wrapper --------- Co-authored-by: Vincent Koc <[email protected]>
Re-submission of #100421, which was closed automatically when the active PR queue was limited. The branch has been rebased onto the latest
main.What Problem This Solves
waitForChildProcessattachesdatalisteners tochild.stdoutandchild.stderr, but does not attacherrorlisteners. If either stream emits anerrorevent, the unhandled error can crash the OpenClaw process even though the child process exit has already been observed.Why This Change Was Made
Add no-op
errorhandlers to both stdout and stderr streams before the data handlers. Stream read errors are treated as non-fatal because the child processerror/exit/closehandlers report the real outcome. The new listeners are also removed incleanupto avoid leaks.User Impact
More robust child process waiting: transient stream read errors no longer crash the agent runtime.
Evidence
Regression test:
Real behavior proof:
The proof spawns a real child process, calls the production
waitForChildProcess, and emits realerrorevents on the child's stdout and stderr streams. With the fix the promise still resolves with the child's exit code: