Skip to content

fix(deepgram): keep the pooled Flux TTS websocket alive between turnsj - #7098

Open
false-vacuum wants to merge 1 commit into
livekit:mainfrom
false-vacuum:fix/deepgram-flux-tts-ws-keepalive
Open

fix(deepgram): keep the pooled Flux TTS websocket alive between turnsj#7098
false-vacuum wants to merge 1 commit into
livekit:mainfrom
false-vacuum:fix/deepgram-flux-tts-ws-keepalive

Conversation

@false-vacuum

Copy link
Copy Markdown

Deepgram closes a Flux TTS session that receives no client message for 60 seconds (NET-0004). TTSv2 pools its streaming websocket for up to an hour and sends nothing on it between turns, so any pause longer than a minute leaves the next turn on a closed socket: either the queued Error frame ("Deepgram Flux TTS returned error") or a write to the closing transport (APIConnectionError). Under a FallbackAdapter the turn is spoken by the next TTS and Flux is marked unavailable until a probe recovers it.

Pass aiohttp's heartbeat on the pooled ws_connect, so the client pings the idle socket and Deepgram's timer keeps resetting. Exposed as keepalive_interval on TTSv2, defaulting to 30s (half the window, the interval stt_v2 already uses); None disables it.

Deepgram closes a Flux TTS session that receives no client message for
60 seconds (NET-0004). TTSv2 pools its streaming websocket for up to an
hour and sends nothing on it between turns, so any pause longer than a
minute leaves the next turn on a closed socket: either the queued Error
frame ("Deepgram Flux TTS returned error") or a write to the closing
transport (APIConnectionError). Under a FallbackAdapter the turn is
spoken by the next TTS and Flux is marked unavailable until a probe
recovers it.

Pass aiohttp's `heartbeat` on the pooled ws_connect, so the client
pings the idle socket and Deepgram's timer keeps resetting. Exposed as
`keepalive_interval` on TTSv2, defaulting to 30s (half the window, the
interval stt_v2 already uses); None disables it.
@false-vacuum
false-vacuum requested a review from a team as a code owner September 2, 2026 16:27
@CLAassistant

CLAassistant commented Sep 2, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants