Skip to content

fix(rtzr): finalize utterances without reconnecting - #7284

Open
kimdwkimdw wants to merge 4 commits into
livekit:mainfrom
kimdwkimdw:feature/rtzr-finalize
Open

kimdwkimdw wants to merge 4 commits into
livekit:mainfrom
kimdwkimdw:feature/rtzr-finalize

Conversation

@kimdwkimdw

Copy link
Copy Markdown
Contributor

Problem

RTZR's flush() sends EOS, closing the WebSocket at each utterance boundary and requiring a new connection for the next utterance. RTZR supports {"type":"Finalize"} to complete an utterance while keeping the connection open.

Receive failures are also logged without reaching the recognition stream, so transcription can stop without triggering LiveKit's error handling.

Fix

Send buffered audio followed by Finalize on flush(). Reuse the connection across utterances and send EOS when input ends or after 25 seconds without audio. Graceful shutdown drains final responses; aclose() cancels immediately.

  • Propagate receive and shutdown failures, preserve pending input across initial connection retries, and report final-response failures after input exhaustion as terminal errors.
  • Reuse the shared progressive audio buffer, validate mono input before resampling, and count sent audio usage once.
  • Refresh tokens before expiry, retry WebSocket authentication once on 401, honor endpoint overrides, and correct per-stream language and word timing metadata.

Replaces #4940.

References

@kimdwkimdw
kimdwkimdw requested a review from a team as a code owner September 15, 2026 09:17
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

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.

1 participant