Skip to content

Commit 2da781a

Browse files
lsr911claude
andcommitted
fix(codex-supervisor): handle stdout/stderr stream errors in JSON-RPC 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]>
1 parent 1252a3d commit 2da781a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

extensions/codex-supervisor/src/json-rpc-client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ class StdioCodexJsonRpcConnection extends BaseCodexJsonRpcConnection {
195195
this.stderrTail.splice(0, Math.max(0, this.stderrTail.length - 40));
196196
});
197197
this.proc.stdin.once("error", (error) => this.fail(error));
198+
this.proc.stdout.on("error", (error) => this.fail(error));
199+
this.proc.stderr.on("error", (error) => this.fail(error));
198200
this.proc.once("error", (error) => this.fail(error));
199201
this.proc.once("close", () =>
200202
this.fail(

0 commit comments

Comments
 (0)