{"record":{"id":"43451427f52acdfc","repo":"openai/codex","slug":"timeout-waiting-for-child-process-to-exit","errorCode":null,"errorMessage":"timeout waiting for child process to exit","messagePattern":"timeout waiting for child process to exit","errorType":"exception","errorClass":"CodexErr","httpStatus":null,"severity":"error","filePath":"codex-rs/protocol/src/error.rs","lineNumber":105,"sourceCode":"\n    /// Returned by ResponsesClient when the SSE stream disconnects or errors out **after** the HTTP\n    /// handshake has succeeded but **before** it finished emitting `response.completed`.\n    ///\n    /// The Session loop treats this as a transient error and will automatically retry the turn.\n    #[error(\"stream disconnected before completion: {0}\")]\n    Stream(String),\n    #[error(\n        \"Codex ran out of room in the model's context window. Start a new thread or clear earlier history before retrying.\"\n    )]\n    ContextWindowExceeded,\n    #[error(\"no thread with id: {0}\")]\n    ThreadNotFound(ThreadId),\n    #[error(\"agent thread limit reached\")]\n    AgentLimitReached { max_threads: usize },\n    #[error(\"session configured event was not the first event in the stream\")]\n    SessionConfiguredNotFirstEvent,\n    /// Returned by run_command_stream when the spawned child process timed out (10s).\n    #[error(\"timeout waiting for child process to exit\")]\n    Timeout,\n    #[error(\"request timed out\")]\n    RequestTimeout,\n    /// Returned by run_command_stream when the child could not be spawned (its stdout/stderr pipes\n    /// could not be captured). Analogous to the previous `CodexError::Spawn` variant.\n    #[error(\"spawn failed: child stdout/stderr not captured\")]\n    Spawn,\n    /// Returned by run_command_stream when the user pressed Ctrl-C (SIGINT). Session uses this to\n    /// surface a polite FunctionCallOutput back to the model instead of crashing the CLI.\n    #[error(\"interrupted (Ctrl-C). Something went wrong? Hit `/feedback` to report the issue.\")]\n    Interrupted,\n    /// Unexpected HTTP status code.\n    #[error(\"{0}\")]\n    UnexpectedStatus(UnexpectedResponseError),\n    /// Invalid request.\n    #[error(\"{0}\")]\n    InvalidRequest(String),\n    /// Multiple registered tools share the same effective name.","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/protocol/src/error.rs#L87-L123","documentation":"Returned by run_command_stream when a spawned child process failed to exit within the hardcoded 10-second grace period after being signaled/asked to stop. It indicates the child ignored termination and had to be treated as hung; the caller cannot collect its exit status.","triggerScenarios":"Thrown at codex-rs/protocol/src/error.rs:105 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Kill the stuck child process manually (pkill or activity monitor) if it lingers","Investigate why the executed program ignores SIGTERM and fix it to handle shutdown signals","Avoid running commands known to hang without their own timeout"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}