fix(realtime): prevent ambiguous multi-agent tool dispatch#3441
Conversation
f428121 to
b378594
Compare
b378594 to
a6b8769
Compare
seratch
left a comment
There was a problem hiding this comment.
This looks good overall. One change before merging: please resolve and validate the initial model settings before registering the session as a model listener. Currently, validation failure during __aenter__ leaves the listener registered because __aexit__ is never called. Please also remove the listener if connect() fails, and add a regression test covering this cleanup behavior.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c0280850c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f9abf70b5c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Thanks for the updates. Please either filter/evaluate override handoffs before duplicate-name validation, or add a test and clarify that |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e95ca35a5c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Note You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e7a4af377c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
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