Repository navigation
fix(speech): final after a held replay is flagged replay even without an original final - #299
Merged
Merged
Conversation
… an original final Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-final-replay # Conflicts: # CHANGELOG.md
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.
Symptom
A host starts an STT hold while the user is speaking, swaps the STT, then calls
releaseSttHold({ replay: true }). The final that followed was sometimes a plainuser_speech_finalwithoutreplay: true, so hosts treated it as a new utterance and waited on a language decision.Cause
Only the vendor-final path honoured the pending replay context. Two other places that emit the utterance final ignored it: the last-partial fallback (finalize without a vendor final) and the forced utterance close (finalize timeout).
Change
emit_utterance_final, is used by all three finalize paths: vendor final, last-partial fallback, forced close. If a replay context is pending, the final is emitted withreplay: true(replacesUtteranceIdonly when an original final existed); otherwise it is a plain final.replay.replayfield comment, STT hold section ofVOICE-API.md, CHANGELOG.Tests
stt_hold_test:held_replay_final_via_last_partial_fallback_is_flagged_replay,held_replay_final_via_forced_close_is_flagged_replay(both fail without the helper),release_replay_after_original_final_keeps_replaces_id. Thereplay_last_utterancepath stays covered byreplay_last_utterance_re_emits_final_on_new_stt_provider.Verified locally and via CI; no extra manual steps.
🤖 Generated with Claude Code