{"record":{"id":"454f32302f26dda2","repo":"openai/codex","slug":"tool-call-tool-call-id-disappeared-during-termin","errorCode":null,"errorMessage":"tool call {tool_call_id} disappeared during terminal observation linking","messagePattern":"tool call (.+?) disappeared during terminal observation linking","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/rollout-trace/src/reducer/tool/terminal.rs","lineNumber":285,"sourceCode":"            bail!(\n                \"terminal session {terminal_id} belongs to thread {}, not {thread_id}\",\n                session.thread_id\n            );\n        }\n        push_unique(&mut session.operation_ids, operation_id);\n        Ok(())\n    }\n\n    /// Mirrors model-visible tool items onto the terminal observation view.\n    ///\n    /// Runtime terminal rows are useful on their own, but the model-visible call\n    /// and output item ids let viewers jump between transcript and terminal timelines.\n    pub(in crate::reducer) fn sync_terminal_model_observation(\n        &mut self,\n        tool_call_id: &str,\n    ) -> Result<()> {\n        let Some(tool_call) = self.rollout.tool_calls.get(tool_call_id) else {\n            bail!(\"tool call {tool_call_id} disappeared during terminal observation linking\");\n        };\n        let Some(operation_id) = tool_call.terminal_operation_id.clone() else {\n            return Ok(());\n        };\n        let call_item_ids = tool_call.model_visible_call_item_ids.clone();\n        let output_item_ids = tool_call.model_visible_output_item_ids.clone();\n        if call_item_ids.is_empty() && output_item_ids.is_empty() {\n            return Ok(());\n        }\n\n        let Some(operation) = self.rollout.terminal_operations.get_mut(&operation_id) else {\n            bail!(\"terminal operation {operation_id} disappeared during observation linking\");\n        };\n        // A terminal result and a model-visible tool output are intentionally\n        // separate: the former is what the runtime saw, the latter is what later\n        // inference payloads prove was shown back to the model.\n        if let Some(observation) = operation\n            .model_observations","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rollout-trace/src/reducer/tool/terminal.rs#L267-L303","documentation":"Error \"tool call {tool_call_id} disappeared during terminal observation linking\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/rollout-trace/src/reducer/tool/terminal.rs:285 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"}