{"record":{"id":"6b819202d7a1f50d","repo":"openai/codex","slug":"tool-call-start-did-not-include-thread-or-codex-tu","errorCode":null,"errorMessage":"tool call start did not include thread or Codex turn context","messagePattern":"tool call start did not include thread or Codex turn context","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/rollout-trace/src/reducer/tool.rs","lineNumber":381,"sourceCode":"                }\n            }\n            ConversationItemKind::Message\n            | ConversationItemKind::Reasoning\n            | ConversationItemKind::CompactionMarker => {}\n        }\n        Ok(())\n    }\n\n    fn tool_thread_id(\n        &self,\n        thread_id: Option<String>,\n        codex_turn_id: Option<&str>,\n    ) -> Result<String> {\n        if let Some(thread_id) = thread_id {\n            return Ok(thread_id);\n        }\n        let Some(codex_turn_id) = codex_turn_id else {\n            bail!(\"tool call start did not include thread or Codex turn context\");\n        };\n        self.rollout\n            .codex_turns\n            .get(codex_turn_id)\n            .map(|turn| turn.thread_id.clone())\n            .with_context(|| {\n                format!(\"tool call start referenced unknown Codex turn {codex_turn_id}\")\n            })\n    }\n\n    fn validate_tool_turn(&self, thread_id: &str, codex_turn_id: Option<&str>) -> Result<()> {\n        if !self.rollout.threads.contains_key(thread_id) {\n            bail!(\"tool call start referenced unknown thread {thread_id}\");\n        }\n        if let Some(codex_turn_id) = codex_turn_id {\n            let Some(turn) = self.rollout.codex_turns.get(codex_turn_id) else {\n                bail!(\"tool call start referenced unknown Codex turn {codex_turn_id}\");\n            };","sourceCodeStart":363,"sourceCodeEnd":399,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rollout-trace/src/reducer/tool.rs#L363-L399","documentation":"Error \"tool call start did not include thread or Codex turn context\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/rollout-trace/src/reducer/tool.rs:381 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"}