Skip to content

Commit c698a81

Browse files
lsr911claude
andcommitted
fix(codex): handle stdout/stderr stream errors in CLI session exec resume
The exec resume child process pipes stdout/stderr for data collection but does not register error handlers on the stdio streams. If a stream errors (e.g. pipe broken), the Promise never settles because only process-level errors are caught. Add child.stdout.on('error', reject) and child.stderr.on('error', reject) inside the Promise constructor alongside the existing child.on('error', reject) to catch stream-level errors. This follows the same pattern as #101505 (mushuiyu886), #101597 (Alix-007), #101401 (cxbAsDev), and #101088 (masatohoshino). Co-Authored-By: Claude <[email protected]>
1 parent 1252a3d commit c698a81

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

extensions/codex/src/node-cli-sessions.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@ async function runCodexExecResume(params: {
296296
child.stdin.end(params.prompt);
297297
const exitCode = await new Promise<number | null>((resolve, reject) => {
298298
child.on("error", reject);
299+
child.stdout.on("error", reject);
300+
child.stderr.on("error", reject);
299301
child.on("exit", (code) => resolve(code));
300302
}).finally(() => {
301303
clearTimeout(timeout);

0 commit comments

Comments
 (0)