fix(acpx): handle target stdout stream errors#101846
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 8, 2026, 1:04 AM ET / 05:04 UTC. Summary PR surface: Source +1, Tests +49. Total +50 across 2 files. Reproducibility: yes. from source and seam evidence, but not from a live non-mocked ACPX run: current main pipes 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:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land the one-line stdout error handler and regression test once a maintainer accepts the seam proof with an override or the PR supplies non-mocked ACPX runtime proof. Do we have a high-confidence way to reproduce the issue? Yes from source and seam evidence, but not from a live non-mocked ACPX run: current main pipes Is this the best way to solve the issue? Yes for the code shape: adding AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 35d5ea069ae9. Label changesLabel justifications:
Evidence reviewedPR surface: Source +1, Tests +49. Total +50 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 (5 earlier review cycles)
|
|
@clawsweeper re-review Maintainer follow-up proof for the current head
Additional stream-contract probe for the previous non-mocked proof concern:
Given that boundary, I don't think a stable non-mocked CLI target can naturally produce this exact parent-side readable stream error; the best direct proof is the Node stream contract plus the proxy-boundary regression test already in the PR. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Maintainer follow-up proof was added to the PR body for exact head Summary of the new proof:
This still intentionally frames the behavior proof as the parent-side Node stream/proxy boundary proof, not as a non-mocked ACPX target transcript. |
What Problem This Solves
Fixes an issue where ACPX-backed MCP proxy sessions could crash with an unhandled stream error when the proxied target stdout stream emits an error.
Why This Change Was Made
The proxy already routes target stdin, proxy stdout, and child process errors through one controlled failure path. This change applies the same local boundary handling to the target stdout stream before piping it to the proxy stdout, without changing ACPX command rewriting or MCP payload behavior.
User Impact
ACPX MCP proxy failures from target stdout streams now exit cleanly with the underlying error instead of surfacing as an unhandled Node stream error.
Evidence
Maintainer follow-up proof (2026-07-08): exact-head runtime seam comparison for
149cd86b70e5b738945c1905347edcd4c15a2ac1exercised the same parent-side target stdout streamerrorevent against base and PR versions ofextensions/acpx/src/runtime-internals/mcp-proxy.mjsusing only Node built-ins plus a temporary preload. Base result:exit=1,hasTargetMessage=true,hasUnhandled=true, first stderr linenode:events:497. PR result:exit=1,hasTargetMessage=true,hasUnhandled=false, first stderr linetarget stdout failed. This proves the addedchild.stdout.on("error", exitWithError)converts the target stdout stream failure into the controlled proxy error path instead of Node's unhandled stream error path.Maintainer follow-up proof (2026-07-08): GitHub Actions
Real behavior proofpassed for exact head149cd86b70e5b738945c1905347edcd4c15a2ac1: run https://github.com/openclaw/openclaw/actions/runs/28890588288, job https://github.com/openclaw/openclaw/actions/runs/28890588288/job/85701964100, completed 2026-07-07T18:50:09Z. The log includesExternal PR includes problem context and evidence.Maintainer follow-up proof (2026-07-08):
git diff --check upstream/main...149cd86b70e5b738945c1905347edcd4c15a2ac1 -- extensions/acpx/src/runtime-internals/mcp-proxy.mjs extensions/acpx/src/runtime-internals/mcp-proxy.test.tspassed.Maintainer follow-up proof (2026-07-08): duplicate search stayed clear: PR search for
acpx mcp proxy stdout errorfound only fix(acpx): handle target stdout stream errors #101846, and issue search for the same query returned[].Maintainer follow-up proof (2026-07-08): removed the leading UTF-8 BOM from this PR body so
scripts/github/real-behavior-proof-check.mjscan recognize the existing## What Problem This Solvesheading. Local policy evaluation changed frommissing: What Problem This Solvestopassed: External PR includes problem context and evidence.Maintainer follow-up proof (2026-07-08):
git diff --check upstream/main...HEADpassed for the two-file PR diff.Maintainer proof gap: local focused Vitest was not run because this clean worktree has no
node_modules; the existing PR CI already ran the focused source/tests, and this edit is body-only.Claim proved: the current
extensions/acpx/src/runtime-internals/mcp-proxy.mjshandles a target stdout streamerrorevent through the proxy error path.Commands / artifacts:
git diff --checkpassed.mcp-proxy.mjs; observed output:target stdout stream error handled.acpx mcp proxy stdout errorreturned[].Observed result: the proxy process exits with code 1, stderr includes
target stdout failed, and stderr does not includeUnhandled 'error' event.Local environment note:
node scripts/run-vitest.mjs extensions/acpx/src/runtime-internals/mcp-proxy.test.tscould not run in the clean worktree becausenode_moduleswas absent; a one-time install attempt in a discarded worktree exposed Windows workspace-link cleanup issues, so this PR leaves full Vitest validation to CI rather than carrying local install side effects.