fix(soniox): sentence-buffer tts input, rotate streams on idle and age#6434
Open
chenghao-mou wants to merge 2 commits into
Open
fix(soniox): sentence-buffer tts input, rotate streams on idle and age#6434chenghao-mou wants to merge 2 commits into
chenghao-mou wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…add plugin tests Adopts hardening from the concurrent #6430: timeout validation, live reconfiguration via update_options, committed plugin tests, and the observed ~8-18s per-stream timeout data point (#6225). Co-Authored-By: Muhammad Qasim <mqasim.bese21seecs@seecs.edu.pk> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
longcw
approved these changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes AGT-3049 (408s breaking the stream mid-reply) and #6225; also covers the FlushSentinel exposure from #6425 / AGT-3132. Concurrent with #6430 by @mqasim41, whose idle-rotation work, observed ~8-18s per-stream timeout data, and test approach are incorporated here with co-author credit.
Why: Soniox times out streams left waiting on slow LLM output (observed ~8-18s, plus a fixed 2-minute per-stream cap), cutting speech mid-reply.
What: LLM chunks are buffered into complete sentences (blingfire, overridable) and fed into one shared stream so prosody stays continuous. If no sentence arrives for
stream_idle_timeout(default 5s, must be >0, reconfigurable viaupdate_options), the stream is finalized withtext_endbefore the server can time it out; the next sentence opens a fresh stream. Streams also rotate at a sentence boundary near the 2-minute cap, and a stream that fails before emitting any audio replays its sentence batch on a newstream_id(the framework never retries once audio reached the user). FlushSentinel now flushes the sentence buffer instead of being dropped.Tests:
pytest tests/test_plugin_soniox_tts.py --plugin soniox(fake connection + virtual time: steady flow, idle rotation, batch replay, validation).🤖 Generated with Claude Code