-
Notifications
You must be signed in to change notification settings - Fork 3.7k
fix(realtime): preserve transport audio formats during agent handoff #2961
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -693,9 +693,11 @@ async def _handle_tool_call( | |
| # Update current agent | ||
| self._current_agent = result | ||
|
|
||
| # Get updated model settings from new agent | ||
| # Get updated model settings from new agent, preserving transport-configured | ||
| # settings (e.g. audio format) from initial_model_settings so they are not | ||
| # reset to defaults during the handoff session update. | ||
| updated_settings = await self._get_updated_model_settings_from_agent( | ||
| starting_settings=None, | ||
| starting_settings=self._model_config.get("initial_model_settings", None), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Passing full Useful? React with 👍 / 👎. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Passing Useful? React with 👍 / 👎. |
||
| agent=self._current_agent, | ||
| ) | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing
initial_model_settingsinto_get_updated_model_settings_from_agenton handoff causes those values to overwrite agent-derived fields, because that helper appliesstarting_settingsafter computinginstructions,tools, andhandoffs. If a caller sets any of those keys ininitial_model_settings(they are validRealtimeSessionModelSettingsfields), a handoff will keep the original configuration instead of switching to the new agent’s behavior. Previously this path passedNone, so the new agent settings were preserved.Useful? React with 👍 / 👎.