{"record":{"id":"a65ef22cc022a14e","repo":"openai/codex","slug":"inference-start-inference-call-id-used-thread-t","errorCode":null,"errorMessage":"inference start {inference_call_id} used thread {thread_id}, but codex turn {codex_turn_id} belongs to {}","messagePattern":"inference start (.+?) used thread (.+?), but codex turn (.+?) belongs to (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/rollout-trace/src/reducer/inference.rs","lineNumber":63,"sourceCode":"            .contains_key(&started.inference_call_id)\n        {\n            bail!(\n                \"duplicate inference start for {}\",\n                started.inference_call_id\n            );\n        }\n\n        let inference_call_id = started.inference_call_id.clone();\n        let thread_id = started.thread_id.clone();\n        let codex_turn_id = started.codex_turn_id.clone();\n        let request_payload = started.request_payload.clone();\n        let Some(turn) = self.rollout.codex_turns.get(&codex_turn_id) else {\n            bail!(\n                \"inference start {inference_call_id} referenced unknown codex turn {codex_turn_id}\"\n            );\n        };\n        if turn.thread_id != thread_id {\n            bail!(\n                \"inference start {inference_call_id} used thread {thread_id}, \\\n                 but codex turn {codex_turn_id} belongs to {}\",\n                turn.thread_id\n            );\n        }\n\n        let request_item_ids = self.reduce_inference_request(\n            wall_time_unix_ms,\n            &inference_call_id,\n            &thread_id,\n            &codex_turn_id,\n            &request_payload,\n        )?;\n\n        self.thread_mut(&thread_id)?;\n\n        self.rollout.inference_calls.insert(\n            inference_call_id.clone(),","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rollout-trace/src/reducer/inference.rs#L45-L81","documentation":"Error \"inference start {inference_call_id} used thread {thread_id}, but codex turn {codex_turn_id} belongs to {}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/rollout-trace/src/reducer/inference.rs:63 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"}