{"record":{"id":"219123fd1d3fc875","repo":"openai/codex","slug":"model-conversation-mismatch-while-reducing-turn-c","errorCode":null,"errorMessage":"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","messagePattern":"model conversation mismatch while reducing turn (.+?) for thread (.+?) at item index (.+?): existing item (.+?) does not match the current model payload item","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/rollout-trace/src/reducer/conversation.rs","lineNumber":230,"sourceCode":"            self.ensure_call_id_consistency(context.thread_id, &item)?;\n            let item_id = if let Some(previous_item_id) = previous_snapshot.get(index) {\n                if self.item_matches(previous_item_id, &item) {\n                    previous_item_id.clone()\n                } else if matches!(context.mode, ReconcileMode::FullSnapshot) {\n                    self.find_matching_snapshot_item(&previous_snapshot, &item_ids, &item)\n                        .unwrap_or_else(|| {\n                            self.create_conversation_item(\n                                context.thread_id,\n                                Some(context.codex_turn_id.to_string()),\n                                context.wall_time_unix_ms,\n                                item,\n                                context.produced_by.clone(),\n                            )\n                        })\n                } else {\n                    let codex_turn_id = context.codex_turn_id;\n                    let thread_id = context.thread_id;\n                    bail!(\n                        \"model conversation mismatch while reducing turn {codex_turn_id} for \\\n                         thread {thread_id} at item index {index}: existing item \\\n                         {previous_item_id} does not match the current model payload item\"\n                    );\n                }\n            } else if matches!(context.mode, ReconcileMode::FullSnapshot) {\n                self.find_matching_snapshot_item(&previous_snapshot, &item_ids, &item)\n                    .unwrap_or_else(|| {\n                        self.create_conversation_item(\n                            context.thread_id,\n                            Some(context.codex_turn_id.to_string()),\n                            context.wall_time_unix_ms,\n                            item,\n                            context.produced_by.clone(),\n                        )\n                    })\n            } else {\n                self.create_conversation_item(","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rollout-trace/src/reducer/conversation.rs#L212-L248","documentation":"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.","triggerScenarios":"Thrown at codex-rs/rollout-trace/src/reducer/conversation.rs:230 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}