fix(agents): suppress unhandled stdout/stderr stream errors in sandbox SSH commands#100746
fix(agents): suppress unhandled stdout/stderr stream errors in sandbox SSH commands#100746lsr911 wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 6, 2026, 7:54 AM ET / 11:54 UTC. Summary PR surface: Source +5, Tests +104. Total +109 across 2 files. Reproducibility: yes. from source, not from a live SSH run: current main attaches data listeners and pipes child streams without matching error listeners, and a direct Node EventEmitter probe confirms an unhandled Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Harden every child stream in the SSH command and upload pipeline through the existing SSH sandbox helpers, make the no-op versus fail-on-incomplete-output behavior deliberate, and prove it with type-clean regression coverage plus redacted terminal or live output. Do we have a high-confidence way to reproduce the issue? Yes from source, not from a live SSH run: current main attaches data listeners and pipes child streams without matching error listeners, and a direct Node EventEmitter probe confirms an unhandled Is this the best way to solve the issue? No as submitted: adding child stream listeners is a plausible fix, but this head misses the piped Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ab534919ff0e. Label changesLabel justifications:
Evidence reviewedPR surface: Source +5, Tests +104. Total +109 across 2 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
Review history (2 earlier review cycles)
|
|
@clawsweeper re-review — updated proof now calls the production function (via spawn patcher injecting stream errors). The proof fails if the production error handlers are removed. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
…x SSH commands Add no-op error listeners on child stdout/stderr in runSshSandboxCommand and uploadDirectoryToSshTarget to prevent unhandled EventEmitter errors from crashing the process. Matches pattern from sibling helpers. Replace standalone proof scripts with Vitest regression tests that verify error listeners are registered on the production code path. Co-Authored-By: Claude <[email protected]>
f1f59dd to
c7860e1
Compare
|
Refactored following vincentkoc's maintainer repair pattern:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Closing as superseded by #101031. Both PRs address unhandled SSH sandbox stdio Thanks @lsr911 for identifying the missing stream guards and adding focused coverage. |
What Problem This Solves
runSshCommandand the tar-over-SSH pipe transfer in sandbox/ssh.ts attachdatalisteners to child process stdout/stderr streams, but do not attacherrorlisteners. If any stream emits anerrorevent, the unhandled error can crash the OpenClaw process.Why This Change Was Made
Add no-op
errorhandlers to all child stdout/stderr streams that have data listeners. Stream read errors are treated as non-fatal because the child processerror/closehandlers already report the real outcome.Changes
src/agents/sandbox/ssh.ts— addchild.stdout.on("error", () => {})andchild.stderr.on("error", () => {})inrunSshCommand(2 lines) +tar.stderr/ssh.stdout/ssh.stderrerror handlers in the pipe transfer path (3 lines)Evidence
🤖 Generated with Claude Code