{"record":{"id":"9201a617ea1a6c64","repo":"openai/codex","slug":"mcp-correlation-referenced-unknown-tool-call-tool","errorCode":null,"errorMessage":"MCP correlation referenced unknown tool call {tool_call_id}","messagePattern":"MCP correlation referenced unknown tool call (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/rollout-trace/src/reducer/tool.rs","lineNumber":178,"sourceCode":"        // reducer when the output is observed after the tool start.\n        for item_id in model_visible_output_item_ids {\n            self.add_tool_output_item(&tool_call_id, &item_id)?;\n        }\n        // The call/output items may have been observed before this tool start.\n        // Re-sync after insertion so terminal observations get both directions\n        // of the model-visible link.\n        self.sync_terminal_model_observation(&tool_call_id)?;\n        Ok(())\n    }\n\n    /// Attaches the bridge-visible MCP UUID after the generic tool call exists.\n    pub(super) fn assign_mcp_tool_call_correlation(\n        &mut self,\n        tool_call_id: ToolCallId,\n        mcp_call_id: McpCallId,\n    ) -> Result<()> {\n        let Some(tool_call) = self.rollout.tool_calls.get_mut(&tool_call_id) else {\n            bail!(\"MCP correlation referenced unknown tool call {tool_call_id}\");\n        };\n        if tool_call.mcp_call_id.replace(mcp_call_id).is_some() {\n            bail!(\"duplicate MCP correlation for tool call {tool_call_id}\");\n        }\n        Ok(())\n    }\n\n    /// Completes the canonical tool call and any terminal operation driven by dispatch output.\n    ///\n    /// Protocol-backed terminal tools end from runtime events; direct tools\n    /// may only have the canonical result payload, so this method handles both paths.\n    pub(super) fn end_tool_call(\n        &mut self,\n        seq: RawEventSeq,\n        wall_time_unix_ms: i64,\n        tool_call_id: ToolCallId,\n        status: ExecutionStatus,\n        result_payload: Option<RawPayloadRef>,","sourceCodeStart":160,"sourceCodeEnd":196,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rollout-trace/src/reducer/tool.rs#L160-L196","documentation":"Error \"MCP correlation referenced unknown tool call {tool_call_id}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/rollout-trace/src/reducer/tool.rs:178 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"}