fix(agents): handle stderr stream errors in tool_search_code child#101022
fix(agents): handle stderr stream errors in tool_search_code child#101022cxbAsDev wants to merge 1 commit into
Conversation
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Codex review: needs maintainer review before merge. Reviewed July 6, 2026, 10:46 PM ET / 02:46 UTC. Summary PR surface: Source +6, Tests +90. Total +96 across 2 files. Reproducibility: yes. source inspection gives a high-confidence reproduction path: emit an 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:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow child-process hardening after required CI is green, keeping stream ownership and regression coverage in Do we have a high-confidence way to reproduce the issue? Yes, source inspection gives a high-confidence reproduction path: emit an Is this the best way to solve the issue? Yes, this is the best narrow fix: the spawn owner handles the stream failure through the existing one-shot settlement path, and ignoring stdout matches the child source's IPC-only log/result contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 632efa2d7343. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +6, Tests +90. Total +96 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
|
e5bd55e to
09fd255
Compare
09fd255 to
2c33f06
Compare
|
@clawsweeper re-review 补充了 proof 脚本的实际运行输出到 PR body。本地验证:
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review\n\nBranch rebased onto latest upstream/main and resolved the testing-export conflict. Test and proof both pass locally; proof output is in the PR body. |
2c33f06 to
a087f40
Compare
f2aab46 to
b41bd6d
Compare
c2310b1 to
b19f539
Compare
b19f539 to
6461f49
Compare
|
Landed the completed fix through stable maintainer PR #101295 as commit The maintainer version keeps the code-mode worker IPC-only, removes the unused stdout pipe, routes stderr stream errors through once-only settlement, terminates the unusable child, and adds the focused regression. It preserves the original contributor credit via Proof:
This PR is being closed as superseded because its fork branch reset during maintainer fixup and exact-head validation, dropping the completed hardening commit. A stable maintainer branch avoided an ongoing force-push loop. Thanks @cxbAsDev for identifying the stream-error bug. For future PRs, please keep Allow edits by maintainers enabled and avoid force-pushing the head while a maintainer fixup/landing pass is underway. |
What Problem This Solves
tool_search_codeowns a Node child whose stderr is piped for bounded diagnostics. A read-side stderrerrorhad no listener, so Node could surface it as an uncaught exception and crash the gateway. The child also created a stdout pipe even though this worker sends logs, bridge calls, and results exclusively over IPC.Why This Change Was Made
The spawn owner now rejects the run through its existing once-only settlement path when stderr fails. Unused stdout is set to
ignore, removing both a needless pipe and its unhandled-error/backpressure surface. The focused regression asserts stderr rejection, child termination, and the exact stdio contract. A bulky one-off proof script and a redundant testing export were removed.User Impact
An OS-level read failure on the
tool_search_codediagnostic pipe now fails only that tool call instead of risking the Gateway process. Normal code-mode logs and results remain on IPC; stderr diagnostics remain bounded and included in exit errors.Evidence
provider=aws,cbx_7d04459d7c6f, public network, no Tailscale, no instance profile, no hydration), exact reviewed headf2aab46b8dda8f19cb86b57e8bdc50311f996e40:pnpm test src/agents/tool-search.stream-errors.test.tspassed 1/1. Runcheck-lintfailure is outside this PR insrc/agents/model-fallback.test.ts; the same unused import exists on currentorigin/main.