fix: rearm follow-up deadline on VAD speech start - #28
Merged
Conversation
When a follow-up turn is open, the follow_up_time deadline races against the user's utterance because STT_VAD_START was unhandled. If the user starts speaking near the end of the window, the deadline fires mid-sentence and cancels the turn. Handle VOICE_ASSISTANT_STT_VAD_START by replacing the short follow-up deadline with the full MaxListen duration once speech is detected, so the user has the same amount of time to finish speaking as they would after a wake word. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
|
thx! |
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.
Summary
During a follow-up turn, the short
follow_up_timedeadline (e.g. 2 seconds) is notreset when the user actually starts speaking. If the utterance takes longer than
follow_up_timeto complete, the device closes the pipeline mid-speech, causing aConnectionResetErroron the Home Assistant side and a dropped turn on the device.This PR handles
VOICE_ASSISTANT_STT_VAD_STARTin the pipeline event switch: when VADdetects speech during a follow-up listening phase, the deadline is rearmed with
MaxListen(15s), giving the user the full listening window to finish their sentence.Changes
evSpeakingevent kindevSpeakinginhandle(): if in a follow-up listening phase, rearm withMaxListenVOICE_ASSISTANT_STT_VAD_START→evSpeakinginpipeline()Test plan
follow_up_timeto 2 secondsConnectionResetError