Skip to content

Commit 9c3ad3b

Browse files
committed
fix(realtime-session): preserve audio format and config fields on agent update
Fixes #317 - Caches and merges last session config to ensure fields like inputAudioFormat/outputAudioFormat are preserved across agent updates - Adds regression test for Twilio scenario - Adds changeset for release tracking
1 parent ea9a263 commit 9c3ad3b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@openai/agents-realtime': patch
3+
---
4+
5+
fix(realtime-session): preserve audio format & other session config fields on agent update
6+
7+
Previously, calling `updateAgent()` rebuilt the session config from a minimal subset of fields and
8+
omitted properties like `inputAudioFormat` / `outputAudioFormat`, `modalities`, `speed`, etc. This
9+
caused the server to fall back to defaults (e.g. `pcm16`), producing loud static in Twilio calls
10+
when a custom format (e.g. `g711_ulaw`) was required.
11+
12+
This change caches the last full session config and merges it when generating a new config so
13+
updates only override dynamic fields (instructions, voice, tools, tracing) while preserving the
14+
rest. A regression test was added to ensure audio formats persist across `updateAgent` calls.

0 commit comments

Comments
 (0)