openai/codex · error

multiple tool calls matched model-visible call id

Error message

multiple tool calls matched model-visible call id {model_visible_call_id}

What it means

While resolving the single tool call for a model-visible call id, multiple matching tool calls were found — the registry invariant of at most one owner is already broken.

Solutions

  1. Find and fix the code path that allowed duplicate owners
  2. Merge the duplicate tool calls before linking
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/rollout-trace/src/reducer/tool.rs:439 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/dcf3e1271a88257d. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/rollout-trace/src/reducer/tool.rs:439

        {
            bail!("duplicate tool call for model-visible call id {model_visible_call_id}");
        }
        Ok(())
    }

    fn single_tool_for_model_visible_call(
        &self,
        model_visible_call_id: &str,
    ) -> Result<Option<ToolCallId>> {
        let mut matching = self
            .rollout
            .tool_calls
            .values()
            .filter(|tool| tool.model_visible_call_id.as_deref() == Some(model_visible_call_id))
            .map(|tool| tool.tool_call_id.clone());
        let first = matching.next();
        if matching.next().is_some() {
            bail!("multiple tool calls matched model-visible call id {model_visible_call_id}");
        }
        Ok(first)
    }

    fn model_visible_tool_item_ids(
        &self,
        thread_id: &str,
        call_id: &str,
        kinds: &[ConversationItemKind],
    ) -> Vec<String> {
        self.rollout
            .conversation_items
            .values()
            .filter(|item| {
                item.thread_id == thread_id
                    && item.call_id.as_deref() == Some(call_id)
                    && kinds.contains(&item.kind)
            })

View on GitHub (pinned to 339751715c)