fix(realtime): prevent ambiguous multi-agent tool dispatch#3441
Open
mavrickdeveloper wants to merge 1 commit into
Open
fix(realtime): prevent ambiguous multi-agent tool dispatch#3441mavrickdeveloper wants to merge 1 commit into
mavrickdeveloper wants to merge 1 commit into
Conversation
f428121 to
b378594
Compare
b378594 to
a6b8769
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
or two handoffs may both be exposed as:
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
UserErrorthat includes the duplicated name and where it came from, for example function tool vs handoff.Tests
UV_FROZEN=1 bash .agents/skills/code-change-verification/scripts/run.sh