openai/codex · error · Error

Child process has no stdout

Error message

Child process has no stdout

What it means

The spawned Codex exec child has no stdout pipe, so protocol output cannot be read. The child is killed and the error raised since the exec protocol requires reading newline-delimited responses from stdout.

Solutions

  1. Spawn the child process with piped stdout so its output can be read.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at sdk/typescript/src/exec.ts:213 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/470fc3b81d53d823. Report an issue: GitHub.

Appendix: source

Thrown at sdk/typescript/src/exec.ts:213

    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) => {
        child.once("exit", (code, signal) => {
          resolve({ code, signal });
        });
      },
    );

    const rl = readline.createInterface({

View on GitHub (pinned to 339751715c)