fix: pipe and close stdin for codex to prevent hang on stdin read
When codex exec receives a prompt as a positional argument, it still tries to read additional input from stdin (prints 'Reading additional input from stdin...'). With stdio stdin set to 'ignore' or default, codex blocks indefinitely waiting for stdin that never comes. Fix: use stdio ['pipe', 'pipe', 'pipe'] and immediately close stdin via child.stdin.end() in both execute.ts (sync) and jobs.ts (async). This signals EOF to codex so it proceeds with the positional prompt.
This commit is contained in:
@@ -77,8 +77,12 @@ export async function executePrompt(
|
||||
|
||||
const child = spawnImpl(command, args, {
|
||||
shell: false,
|
||||
stdio: ["pipe", "pipe", "pipe"],
|
||||
});
|
||||
|
||||
// Close stdin immediately so clients like codex don't hang waiting for input
|
||||
child.stdin?.end();
|
||||
|
||||
child.stdout?.on("data", (chunk: Buffer | string) => {
|
||||
stdout += chunk.toString();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user