Commit ff03a4d
committed
fix(realtime): preserve transport audio formats during agent handoff
During agent handoff in _handle_tool_call, _get_updated_model_settings_from_agent
was called with starting_settings=None, causing session.update to reset
input_audio_format and output_audio_format back to pcm16 defaults.
This overwrote transport-configured audio formats (e.g. g711_ulaw for Twilio),
closing the Twilio session and sending noise over the phone.
Fix: pass starting_settings=self._model_config.get("initial_model_settings", None)
to mirror the behaviour of __aenter__, which correctly preserves audio formats
on initial connect.
Fixes #16321 parent da82b2c commit ff03a4d
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
693 | 693 | | |
694 | 694 | | |
695 | 695 | | |
696 | | - | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
697 | 699 | | |
698 | | - | |
| 700 | + | |
699 | 701 | | |
700 | 702 | | |
701 | 703 | | |
| |||
0 commit comments