Skip to content

fix(codex-supervisor): handle stdout/stderr stream errors in JSON-RPC client#102387

Closed
lsr911 wants to merge 1 commit into
openclaw:mainfrom
lsr911:fix/supervisor-stream-errors
Closed

fix(codex-supervisor): handle stdout/stderr stream errors in JSON-RPC client#102387
lsr911 wants to merge 1 commit into
openclaw:mainfrom
lsr911:fix/supervisor-stream-errors

Conversation

@lsr911

@lsr911 lsr911 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

The StdioCodexJsonRpcConnection registers data handlers on proc.stdout and proc.stderr, plus error handlers on proc.stdin and the process itself (proc.once("error")), but does not register error handlers on the stdout or stderr streams. If either stream errors (e.g. pipe broken, EPIPE), the error is unhandled and the JSON-RPC connection may hang silently.

Why This Change Was Made

Adds this.proc.stdout.on("error", ...) and this.proc.stderr.on("error", ...) that call this.fail(error), matching the existing stdin and process-level error handling.

Same stream error handler pattern as #101505, #101597, #101401, #101088, #102385, and #102386.

Files Changed

File Change
extensions/codex-supervisor/src/json-rpc-client.ts +2 lines: stdout/stderr error handlers

🤖 Generated with Claude Code

Co-Authored-By: Claude [email protected]

… client

The stdio-proxy JSON-RPC connection registers data handlers on
stdout and stderr streams, plus error handlers on stdin and the
process itself, but does not register error handlers on stdout
or stderr. If either stream errors (e.g. pipe broken), the error
is unhandled and the connection may hang.

Add error handlers on proc.stdout and proc.stderr that call
this.fail(error), matching the existing stdin and process-level
error handling.

Co-Authored-By: Claude <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added extensions: codex-supervisor Extension: codex-supervisor triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. size: XS labels Jul 9, 2026
@clawsweeper

clawsweeper Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

This PR should close because #101599 is the older, open, proof-positive canonical fix for the same Codex Supervisor stdio stream-error gap, and this branch also uses the unsafe stderr-as-fatal behavior that the canonical PR corrected.

Root-cause cluster
Relationship: superseded
Canonical: #101599
Summary: This PR and the canonical replacement both target the Codex Supervisor stdio stdout/stderr stream-error gap; the canonical replacement is older, proof-positive, assigned, and uses the safer maintainer-approved semantics.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Close this duplicate branch and focus review on #101599, which preserves stdout as the fatal JSON-RPC channel and keeps stderr diagnostic-only with proof.

So I’m closing this here and keeping the remaining discussion on #101599.

Review details

Best possible solution:

Close this duplicate branch and focus review on #101599, which preserves stdout as the fatal JSON-RPC channel and keeps stderr diagnostic-only with proof.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main has stdout/stderr data listeners in the Codex Supervisor stdio transport without readable stream error listeners, and the same path is exercised by the canonical replacement PR's real spawned Node stdio tests.

Is this the best way to solve the issue?

No. This PR is not the best fix because it makes stderr stream errors terminal; the better solution is the canonical replacement that matches the upstream Codex stdout JSON-RPC and stderr diagnostics contract.

Security review:

Security review cleared: No concrete security or supply-chain regression was found; the diff only changes child stdio stream error handling in an existing bundled plugin.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • vincentkoc: They are assigned on the canonical replacement PR and authored the maintainer comment closing the earlier unsafe same-path attempt with the stdout-fatal and stderr-diagnostic direction. (role: likely follow-up owner; confidence: high; commits: 846195c6b001; files: extensions/codex-supervisor/src/json-rpc-client.ts, extensions/codex/src/app-server/client.ts)
  • Alix-007: They authored the open canonical PR that implements the same Codex Supervisor stdio stream-error fix with tests and real behavior proof. (role: canonical replacement author; confidence: high; commits: bd9acd0439c3; files: extensions/codex-supervisor/src/json-rpc-client.ts, extensions/codex-supervisor/src/json-rpc-client.test.ts)
  • joshavant: Local git blame in this shallow checkout attributes the current Codex Supervisor stdio connection implementation to commit 17fafcc. (role: current-main blame signal; confidence: medium; commits: 17fafcc9012c; files: extensions/codex-supervisor/src/json-rpc-client.ts, extensions/codex-supervisor/src/supervisor.ts, extensions/codex-supervisor/openclaw.plugin.json)
  • mushuiyu886: They authored the merged adjacent Codex app-server stdio stream-error fix whose current-main behavior is the closest precedent for this transport boundary. (role: adjacent implementation contributor; confidence: medium; commits: 846195c6b001; files: extensions/codex/src/app-server/client.ts, extensions/codex/src/app-server/client.test.ts)

Codex review notes: model internal, reasoning high; reviewed against e90bf3182927.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jul 9, 2026
@lsr911

lsr911 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #101599 which is the older, proof-positive canonical fix for the same Codex Supervisor stdio stream-error gap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: codex-supervisor Extension: codex-supervisor merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant