Repository navigation
fix(tts): surface post-cold-start streaming_call failures instead of dropping the delta - #3621
Merged
qbc2016 merged 2 commits intoNov 2, 2026
Conversation
…dropping the delta
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.
AgentScope Version
2.0.12dev (main @
4acacb9)Description
CosyVoiceModel.push()(realtime mode) silently drops the current text delta whenstreaming_callraises after the cold-start latch is set (src/agentscope/tts/_dashscope/_cosyvoice_model.py:286-291): theexceptbranch returnsTTSResponse(content=None)based on a recovery promise ("keep the cold-start buffer and flag intact so the next push retries it") that only holds during the cold-start phase. Once the latch is set the buffer is empty, so the failed delta exists only in_accumulated_textand is never sent — the synthesized speech silently misses words, with no error or log (#3620).The surrounding code consistently chooses otherwise: the
not self._connectedguard right above raises, and_synthesize_realtimeretries and eventually raises. #3535 built the cold-start failure handling this comment refers to — the post-cold-start path is its remaining gap.Changes — the
exceptbranch now distinguishes the two phases:not self._cold_start_done): unchanged — keep the buffer and flag intact so the next push retries the whole buffered text (fix(tts): keep CosyVoice cold-start buffer when the send fails #3535 behavior preserved);_connectedguard above — the caller still holds the text and can retry, instead of the delta vanishing from the synthesized speech.How to test
New case in the existing
CosyVoicePushTest(tests/tts_dashscope_test.py):test_push_after_cold_start_raises_on_send_failure— fails onmain(the push returnsTTSResponse(content=None)and the delta vanishes), passes with this fix;test_push_keeps_cold_start_buffer_on_send_failure) is untouched and still passes, pinning the fix(tts): keep CosyVoice cold-start buffer when the send fails #3535 behavior.python -m pytest tests/tts_dashscope_test.py # 73 passed.Fixes #3620
Checklist