openai/codex · error · CodexErr
timeout waiting for child process to exit
Error message
timeout waiting for child process to exit
What it means
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.
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
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at codex-rs/protocol/src/error.rs:105 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/43451427f52acdfc.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/protocol/src/error.rs:105
/// Returned by ResponsesClient when the SSE stream disconnects or errors out **after** the HTTP
/// handshake has succeeded but **before** it finished emitting `response.completed`.
///
/// The Session loop treats this as a transient error and will automatically retry the turn.
#[error("stream disconnected before completion: {0}")]
Stream(String),
#[error(
"Codex ran out of room in the model's context window. Start a new thread or clear earlier history before retrying."
)]
ContextWindowExceeded,
#[error("no thread with id: {0}")]
ThreadNotFound(ThreadId),
#[error("agent thread limit reached")]
AgentLimitReached { max_threads: usize },
#[error("session configured event was not the first event in the stream")]
SessionConfiguredNotFirstEvent,
/// Returned by run_command_stream when the spawned child process timed out (10s).
#[error("timeout waiting for child process to exit")]
Timeout,
#[error("request timed out")]
RequestTimeout,
/// Returned by run_command_stream when the child could not be spawned (its stdout/stderr pipes
/// could not be captured). Analogous to the previous `CodexError::Spawn` variant.
#[error("spawn failed: child stdout/stderr not captured")]
Spawn,
/// Returned by run_command_stream when the user pressed Ctrl-C (SIGINT). Session uses this to
/// surface a polite FunctionCallOutput back to the model instead of crashing the CLI.
#[error("interrupted (Ctrl-C). Something went wrong? Hit `/feedback` to report the issue.")]
Interrupted,
/// Unexpected HTTP status code.
#[error("{0}")]
UnexpectedStatus(UnexpectedResponseError),
/// Invalid request.
#[error("{0}")]
InvalidRequest(String),
/// Multiple registered tools share the same effective name.View on GitHub (pinned to 339751715c)