openai/codex · error · anyhow::Error

model conversation mismatch while reducing turn {codex_turn_

Error message

model conversation mismatch while reducing turn {codex_turn_id} for thread {thread_id} at item index {index}: existing item {previous_item_id} does not match the current model payload item

What it means

Error "model conversation mismatch while reducing turn {codex_turn_id} for thread {thread_id} at item index {index}: existing item {previous_item_id} does not match the current model payload item" thrown in openai/codex.

Source

Thrown at codex-rs/rollout-trace/src/reducer/conversation.rs:230

            self.ensure_call_id_consistency(context.thread_id, &item)?;
            let item_id = if let Some(previous_item_id) = previous_snapshot.get(index) {
                if self.item_matches(previous_item_id, &item) {
                    previous_item_id.clone()
                } else if matches!(context.mode, ReconcileMode::FullSnapshot) {
                    self.find_matching_snapshot_item(&previous_snapshot, &item_ids, &item)
                        .unwrap_or_else(|| {
                            self.create_conversation_item(
                                context.thread_id,
                                Some(context.codex_turn_id.to_string()),
                                context.wall_time_unix_ms,
                                item,
                                context.produced_by.clone(),
                            )
                        })
                } else {
                    let codex_turn_id = context.codex_turn_id;
                    let thread_id = context.thread_id;
                    bail!(
                        "model conversation mismatch while reducing turn {codex_turn_id} for \
                         thread {thread_id} at item index {index}: existing item \
                         {previous_item_id} does not match the current model payload item"
                    );
                }
            } else if matches!(context.mode, ReconcileMode::FullSnapshot) {
                self.find_matching_snapshot_item(&previous_snapshot, &item_ids, &item)
                    .unwrap_or_else(|| {
                        self.create_conversation_item(
                            context.thread_id,
                            Some(context.codex_turn_id.to_string()),
                            context.wall_time_unix_ms,
                            item,
                            context.produced_by.clone(),
                        )
                    })
            } else {
                self.create_conversation_item(

View on GitHub (pinned to 339751715c)

When it happens

Trigger: Thrown at codex-rs/rollout-trace/src/reducer/conversation.rs:230 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/219123fd1d3fc875. Report an issue: GitHub.