Repository navigation
fix(agents): avoid shell snapshot stdout pipe failures - #100744
Conversation
…t runShell Signed-off-by: 廖石荣 0668000909 <[email protected]>
|
Codex review: needs real behavior proof before merge. Reviewed July 6, 2026, 6:08 AM ET / 10:08 UTC. Summary PR surface: Source -6, Tests +71. Total +65 across 2 files. Reproducibility: yes. from source inspection, but not from an executed current-main repro in this read-only review. Current main creates an unused child stdout pipe without an error listener, and Node's EventEmitter source throws on unhandled error events. Review metrics: 1 noteworthy metric.
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
Maintainer decision needed
Security Review detailsBest possible solution: Land the narrow stdio-ignore fix with the production-path regression test after a maintainer either receives real shell-snapshot or host exec proof, or explicitly overrides the external-PR proof gate. Do we have a high-confidence way to reproduce the issue? Yes from source inspection, but not from an executed current-main repro in this read-only review. Current main creates an unused child stdout pipe without an error listener, and Node's EventEmitter source throws on unhandled error events. Is this the best way to solve the issue? Yes for the code shape: ignoring stdio is narrower than adding a no-op listener because both runShell callers only consume status and capture output is read from a private temp file. Proof sufficiency remains unresolved for merge. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fa70403403da. Label changesLabel justifications:
Evidence reviewedPR surface: Source -6, Tests +71. Total +65 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 (1 earlier review cycle)
|
efe1ba1 to
b49a115
Compare
|
Maintainer repair pushed at lsr911@b49a115. Addressed the current review findings:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Follow-up maintainer repair pushed at lsr911@fcf8172. The prior exact-head CI guard annotation is addressed by using Focused proof remains green:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
…ream errors Signed-off-by: 廖石荣 0668000909 <[email protected]>
fcf8172 to
6b39aa9
Compare
|
@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. |
|
Maintainer repair refreshed after the contributor update: lsr911@ce669bd. This preserves both contributor commits, then:
Focused proof at this exact tree:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Landing is paused at exact head Exact-head CI: https://github.com/openclaw/openclaw/actions/runs/28783046101 The blocking failures are outside this PR's two-file diff:
The shell-snapshot patch itself has focused 14/14 tests, type-aware oxlint, oxfmt, diff check, temp-dir guard, and fresh autoreview green. I am not adding unrelated gateway or shrinkwrap changes to this contributor PR. |
|
Land-ready proof for exact head
No docs or changelog change is required for this narrow internal reliability fix. |
|
Merged via squash.
|
* fix(agents): suppress unhandled stdout stream errors in shell-snapshot runShell Signed-off-by: 廖石荣 0668000909 <[email protected]> * proof: rewrite to exercise production shell-snapshot with injected stream errors Signed-off-by: 廖石荣 0668000909 <[email protected]> * fix(agents): avoid unused shell snapshot stdout pipe * chore: refresh CI after mainline drift --------- Signed-off-by: 廖石荣 0668000909 <[email protected]> Co-authored-by: Vincent Koc <[email protected]>
* fix(agents): suppress unhandled stdout stream errors in shell-snapshot runShell Signed-off-by: 廖石荣 0668000909 <[email protected]> * proof: rewrite to exercise production shell-snapshot with injected stream errors Signed-off-by: 廖石荣 0668000909 <[email protected]> * fix(agents): avoid unused shell snapshot stdout pipe * chore: refresh CI after mainline drift --------- Signed-off-by: 廖石荣 0668000909 <[email protected]> Co-authored-by: Vincent Koc <[email protected]> (cherry picked from commit 428ee12)
What Problem This Solves
Fixes an issue where shell snapshot helper commands could crash OpenClaw if their unused stdout pipe emitted a stream error.
Why This Change Was Made
Both
runShellcallers only consume the child exit status, while snapshot capture output is already redirected to a private temporary file. The helper now spawns with ignored stdio instead of creating and draining an unused stdout pipe, removing the error source entirely.The original report and fix direction remain credited to @lsr911. The maintainer repair replaces the standalone proof script with durable coverage of the production shell-snapshot path.
User Impact
Shell snapshot capture and validation no longer expose an unused stdout stream that can emit an unhandled error. Existing fallback, timeout, and process-tree cleanup behavior is unchanged.
Evidence
node scripts/run-vitest.mjs src/agents/shell-snapshot.spawn.test.ts src/agents/shell-snapshot.test.ts- 14/14 passed.stdio: ["ignore", "pipe", "ignore"]makesshell-snapshot.spawn.test.tsfail on the production spawn contract.node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/agents/shell-snapshot.ts src/agents/shell-snapshot.spawn.test.ts- passed../node_modules/.bin/oxfmt --check src/agents/shell-snapshot.ts src/agents/shell-snapshot.spawn.test.ts- passed.git diff --check origin/main...HEAD- passed.codex review --base origin/main- no findings; confirmed ignored stdio is the correct fix because neither caller consumes stdout.Focused local proof only. Testbox was intentionally not used because Blacksmith is unavailable.