openai/codex · error · anyhow::Error
MCP correlation referenced unknown tool call {tool_call_id}
Error message
MCP correlation referenced unknown tool call {tool_call_id} What it means
Error "MCP correlation referenced unknown tool call {tool_call_id}" thrown in openai/codex.
Source
Thrown at codex-rs/rollout-trace/src/reducer/tool.rs:178
// reducer when the output is observed after the tool start.
for item_id in model_visible_output_item_ids {
self.add_tool_output_item(&tool_call_id, &item_id)?;
}
// The call/output items may have been observed before this tool start.
// Re-sync after insertion so terminal observations get both directions
// of the model-visible link.
self.sync_terminal_model_observation(&tool_call_id)?;
Ok(())
}
/// Attaches the bridge-visible MCP UUID after the generic tool call exists.
pub(super) fn assign_mcp_tool_call_correlation(
&mut self,
tool_call_id: ToolCallId,
mcp_call_id: McpCallId,
) -> Result<()> {
let Some(tool_call) = self.rollout.tool_calls.get_mut(&tool_call_id) else {
bail!("MCP correlation referenced unknown tool call {tool_call_id}");
};
if tool_call.mcp_call_id.replace(mcp_call_id).is_some() {
bail!("duplicate MCP correlation for tool call {tool_call_id}");
}
Ok(())
}
/// Completes the canonical tool call and any terminal operation driven by dispatch output.
///
/// Protocol-backed terminal tools end from runtime events; direct tools
/// may only have the canonical result payload, so this method handles both paths.
pub(super) fn end_tool_call(
&mut self,
seq: RawEventSeq,
wall_time_unix_ms: i64,
tool_call_id: ToolCallId,
status: ExecutionStatus,
result_payload: Option<RawPayloadRef>,View on GitHub (pinned to 339751715c)
When it happens
Trigger: Thrown at codex-rs/rollout-trace/src/reducer/tool.rs:178 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/9201a617ea1a6c64.
Report an issue: GitHub.