openai/codex · error · anyhow::Error

terminal session {terminal_id} disappeared during reduction

Error message

terminal session {terminal_id} disappeared during reduction

What it means

Error "terminal session {terminal_id} disappeared during reduction" thrown in openai/codex.

Source

Thrown at codex-rs/rollout-trace/src/reducer/tool/terminal.rs:264

                    thread_id: thread_id.to_string(),
                    created_by_operation_id: operation_id.to_string(),
                    operation_ids: Vec::new(),
                    execution: ExecutionWindow {
                        started_at_unix_ms,
                        started_seq,
                        // Current raw events do not report a terminal/session
                        // shutdown boundary, so the session remains open even
                        // after individual operations complete.
                        ended_at_unix_ms: None,
                        ended_seq: None,
                        status: ExecutionStatus::Running,
                    },
                },
            );
        }

        let Some(session) = self.rollout.terminal_sessions.get_mut(terminal_id) else {
            bail!("terminal session {terminal_id} disappeared during reduction");
        };
        if session.thread_id != thread_id {
            bail!(
                "terminal session {terminal_id} belongs to thread {}, not {thread_id}",
                session.thread_id
            );
        }
        push_unique(&mut session.operation_ids, operation_id);
        Ok(())
    }

    /// Mirrors model-visible tool items onto the terminal observation view.
    ///
    /// Runtime terminal rows are useful on their own, but the model-visible call
    /// and output item ids let viewers jump between transcript and terminal timelines.
    pub(in crate::reducer) fn sync_terminal_model_observation(
        &mut self,
        tool_call_id: &str,

View on GitHub (pinned to 339751715c)

When it happens

Trigger: Thrown at codex-rs/rollout-trace/src/reducer/tool/terminal.rs:264 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/9fb44c1fef4edb8e. Report an issue: GitHub.