Skip to content

Commit d65fd08

Browse files
sunlit-dengsteipete
authored andcommitted
fix(openai): bound realtime voice websocket payload at 16 MiB
1 parent a905eb4 commit d65fd08

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

extensions/openai/realtime-voice-provider.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ const OPENAI_REALTIME_ACTIVE_RESPONSE_ERROR_PREFIX =
9393
const OPENAI_REALTIME_NO_ACTIVE_RESPONSE_CANCEL_ERROR =
9494
"Cancellation failed: no active response found";
9595
const OPENAI_REALTIME_MAX_SESSION_DURATION_FRAGMENT = "maximum duration";
96+
const OPENAI_VOICE_WS_MAX_PAYLOAD_BYTES = 16 * 1024 * 1024;
9697
const OPENAI_REALTIME_DEFAULT_MIN_BARGE_IN_AUDIO_END_MS = 250;
9798
// Realtime validates this character set but accepts names beyond the 64-character
9899
// cap used by other OpenAI tool surfaces.
@@ -616,6 +617,7 @@ class OpenAIRealtimeVoiceBridge implements RealtimeVoiceBridge {
616617
const proxyAgent = createDebugProxyWebSocketAgent(debugProxy);
617618
const ws = new WebSocket(connection.url, {
618619
headers: connection.headers,
620+
maxPayload: OPENAI_VOICE_WS_MAX_PAYLOAD_BYTES,
619621
...(proxyAgent ? { agent: proxyAgent } : {}),
620622
});
621623
this.ws = ws;

0 commit comments

Comments
 (0)