openai/codex · error · anyhow::Error
in-process app-server shutdown failed
Error message
in-process app-server shutdown failed: {err} What it means
Bailed by run_exec_session during shutdown when the in-process app-server client fails to shut down cleanly after the run completes (e.g. fork-only path). The session work is done; this error surfaces the teardown failure of the embedded server.
Solutions
- Investigate the app-server shutdown failure per the reported error.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at codex-rs/exec/src/lib.rs:962 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/7c8374f378fd9221.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/exec/src/lib.rs:962
info!("Codex initialized with event: {session_configured:?}");
let (interrupt_tx, mut interrupt_rx) = mpsc::unbounded_channel::<()>();
tokio::spawn(async move {
if tokio::signal::ctrl_c().await.is_ok() {
tracing::debug!("Keyboard interrupt");
let _ = interrupt_tx.send(());
}
});
let task_id = match initial_operation {
InitialOperation::ForkOnly => {
request_shutdown(&client, &mut request_ids, &primary_thread_id_for_span)
.await
.map_err(anyhow::Error::msg)?;
client
.shutdown()
.await
.map_err(|err| anyhow::anyhow!("in-process app-server shutdown failed: {err}"))?;
event_processor.print_final_output();
return Ok(());
}
InitialOperation::UserTurn {
items,
output_schema,
} => {
let response: TurnStartResponse = send_request_with_response(
&client,
ClientRequest::TurnStart {
request_id: request_ids.next(),
params: TurnStartParams {
thread_id: primary_thread_id_for_span.clone(),
client_user_message_id: None,
input: items.into_iter().map(Into::into).collect(),
responsesapi_client_metadata: None,
additional_context: None,
environments: None,View on GitHub (pinned to 339751715c)