Skip to content

Commit 4d792f1

Browse files
lsr911claude
andcommitted
fix(codex): make stream error handler idempotent in sandbox exec processes
If both stdout and stderr emit errors, the second error would overwrite the first failure message. Add an early return guard so only the first stream error is preserved, matching the expected behavior where Codex consumes process/read.failure. Co-Authored-By: Claude <[email protected]>
1 parent 694ca1b commit 4d792f1

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • extensions/codex/src/app-server/sandbox-exec-server

extensions/codex/src/app-server/sandbox-exec-server/processes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ async function runProcess(
120120
);
121121
child.stderr.on("data", (chunk: Buffer) => appendProcessChunk(managed, "stderr", chunk));
122122
const onStreamError = (error: Error) => {
123+
if (managed.failure) return;
123124
managed.failure = error.message;
124125
emitProcessClosed(managed, null);
125126
};

0 commit comments

Comments
 (0)