{"record":{"id":"0dbd92d80f84f0f5","repo":"openai/codex","slug":"codex-exec-exited-with-detail-stderrbuffer-t","errorCode":null,"errorMessage":"Codex Exec exited with ${detail}: ${stderrBuffer.toString(\"utf8\")}","messagePattern":"Codex Exec exited with (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"sdk/typescript/src/exec.ts","lineNumber":247,"sourceCode":"    );\n\n    const rl = readline.createInterface({\n      input: child.stdout,\n      crlfDelay: Infinity,\n    });\n\n    try {\n      for await (const line of rl) {\n        // `line` is a string (Node sets default encoding to utf8 for readline)\n        yield line as string;\n      }\n\n      if (spawnError) throw spawnError;\n      const { code, signal } = await exitPromise;\n      if (code !== 0 || signal) {\n        const stderrBuffer = Buffer.concat(stderrChunks);\n        const detail = signal ? `signal ${signal}` : `code ${code ?? 1}`;\n        throw new Error(`Codex Exec exited with ${detail}: ${stderrBuffer.toString(\"utf8\")}`);\n      }\n    } finally {\n      rl.close();\n      child.removeAllListeners();\n      try {\n        if (!child.killed) child.kill();\n      } catch {\n        // ignore\n      }\n    }\n  }\n}\n\nfunction serializeConfigOverrides(configOverrides: CodexConfigObject): string[] {\n  const overrides: string[] = [];\n  flattenConfigOverrides(configOverrides, \"\", overrides);\n  return overrides;\n}","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/sdk/typescript/src/exec.ts#L229-L265","documentation":"Error \"Codex Exec exited with ${detail}: ${stderrBuffer.toString(\"utf8\")}\" thrown in openai/codex.","triggerScenarios":"Thrown at sdk/typescript/src/exec.ts:247 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the stderr text in the message for the exit cause, fix the underlying problem, and rerun codex exec."],"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"}