{"record":{"id":"51d2503af1e5d570","repo":"openai/codex","slug":"duplicate-mcp-correlation-for-tool-call-tool-call","errorCode":null,"errorMessage":"duplicate MCP correlation for tool call {tool_call_id}","messagePattern":"duplicate MCP correlation for tool call (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"codex-rs/rollout-trace/src/reducer/tool.rs","lineNumber":181,"sourceCode":"        }\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>,\n    ) -> Result<()> {\n        let (terminal_operation_id, thread_id, end_terminal_from_result) = {\n            let Some(tool_call) = self.rollout.tool_calls.get_mut(&tool_call_id) else {","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rollout-trace/src/reducer/tool.rs#L163-L199","documentation":"Error \"duplicate MCP correlation for tool call {tool_call_id}\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/rollout-trace/src/reducer/tool.rs:181 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"}