Skip to content

fix(realtime): prevent ambiguous multi-agent tool dispatch#3441

Open
mavrickdeveloper wants to merge 1 commit into
openai:mainfrom
mavrickdeveloper:fix/realtime-multi-agent-tool-dispatch
Open

fix(realtime): prevent ambiguous multi-agent tool dispatch#3441
mavrickdeveloper wants to merge 1 commit into
openai:mainfrom
mavrickdeveloper:fix/realtime-multi-agent-tool-dispatch

Conversation

@mavrickdeveloper
Copy link
Copy Markdown
Contributor

Summary

This pull request fixes ambiguous Realtime tool dispatch by rejecting duplicate model-visible names across Realtime function tools and handoffs.

Motivation

This came up while working with a multi-agent Realtime setup where tools and handoffs were composed together from different agent modules. In that kind of system, function tools and handoffs share the same callable namespace from the model's point of view, so duplicate names can become ambiguous without being obvious at setup time.

For example, a triage agent may end up with both:

function tool: transfer_to_billing
handoff tool: transfer_to_billing

or two handoffs may both be exposed as:

transfer_to_support

Before this change, Realtime could accept that configuration and later build SDK-side lookup maps keyed only by name. That means one entry could silently overwrite another, making it unclear whether a model call should run a Python function or transfer to another agent.

Changes

  • Adds Realtime-specific duplicate-name validation for model-visible function tool and handoff names.
  • Validates before Realtime session tools are serialized and sent to the model.
  • Validates again before local tool-call dispatch, so ambiguous runtime state fails clearly.
  • Raises a UserError that includes the duplicated name and where it came from, for example function tool vs handoff.
  • Only checks the tools and handoffs that are actually enabled for the session, so disabled handoffs do not cause false conflicts.

Tests

  • UV_FROZEN=1 bash .agents/skills/code-change-verification/scripts/run.sh

@mavrickdeveloper mavrickdeveloper marked this pull request as ready for review May 17, 2026 12:19
@mavrickdeveloper mavrickdeveloper force-pushed the fix/realtime-multi-agent-tool-dispatch branch from f428121 to b378594 Compare May 19, 2026 07:39
@mavrickdeveloper mavrickdeveloper force-pushed the fix/realtime-multi-agent-tool-dispatch branch from b378594 to a6b8769 Compare May 19, 2026 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants