openai/codex · error · Error
Child process has no stdin
Error message
Child process has no stdin
What it means
Error "Child process has no stdin" thrown in openai/codex.
Source
Thrown at sdk/typescript/src/exec.ts:206
}
if (args.apiKey) {
env.CODEX_API_KEY = args.apiKey;
}
if (this.pathDirs.length > 0) {
prependPathDirs(env, this.pathDirs);
}
const child = spawn(this.executablePath, commandArgs, {
env,
signal: args.signal,
});
let spawnError: unknown | null = null;
child.once("error", (err) => (spawnError = err));
if (!child.stdin) {
child.kill();
throw new Error("Child process has no stdin");
}
child.stdin.write(args.input);
child.stdin.end();
if (!child.stdout) {
child.kill();
throw new Error("Child process has no stdout");
}
const stderrChunks: Buffer[] = [];
if (child.stderr) {
child.stderr.on("data", (data) => {
stderrChunks.push(data);
});
}
const exitPromise = new Promise<{ code: number | null; signal: NodeJS.Signals | null }>(
(resolve) => {View on GitHub (pinned to 339751715c)
Solutions
- Spawn the child process with piped stdin so input can be written to it.
When it happens
Trigger: Thrown at sdk/typescript/src/exec.ts:206 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/7146391c01a7c7e2.
Report an issue: GitHub.