{"record":{"id":"7146391c01a7c7e2","repo":"openai/codex","slug":"child-process-has-no-stdin","errorCode":null,"errorMessage":"Child process has no stdin","messagePattern":"Child process has no stdin","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"sdk/typescript/src/exec.ts","lineNumber":206,"sourceCode":"    }\n    if (args.apiKey) {\n      env.CODEX_API_KEY = args.apiKey;\n    }\n    if (this.pathDirs.length > 0) {\n      prependPathDirs(env, this.pathDirs);\n    }\n\n    const child = spawn(this.executablePath, commandArgs, {\n      env,\n      signal: args.signal,\n    });\n\n    let spawnError: unknown | null = null;\n    child.once(\"error\", (err) => (spawnError = err));\n\n    if (!child.stdin) {\n      child.kill();\n      throw new Error(\"Child process has no stdin\");\n    }\n    child.stdin.write(args.input);\n    child.stdin.end();\n\n    if (!child.stdout) {\n      child.kill();\n      throw new Error(\"Child process has no stdout\");\n    }\n    const stderrChunks: Buffer[] = [];\n\n    if (child.stderr) {\n      child.stderr.on(\"data\", (data) => {\n        stderrChunks.push(data);\n      });\n    }\n\n    const exitPromise = new Promise<{ code: number | null; signal: NodeJS.Signals | null }>(\n      (resolve) => {","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/sdk/typescript/src/exec.ts#L188-L224","documentation":"Error \"Child process has no stdin\" thrown in openai/codex.","triggerScenarios":"Thrown at sdk/typescript/src/exec.ts:206 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Spawn the child process with piped stdin so input can be written to it."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}