Skip to content

fix: rearm follow-up deadline on VAD speech start - #28

Merged
ygelfand merged 1 commit into
ygelfand:mainfrom
volfyd:main
Sep 4, 2026
Merged

fix: rearm follow-up deadline on VAD speech start#28
ygelfand merged 1 commit into
ygelfand:mainfrom
volfyd:main

Conversation

@volfyd

@volfyd volfyd commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

During a follow-up turn, the short follow_up_time deadline (e.g. 2 seconds) is not
reset when the user actually starts speaking. If the utterance takes longer than
follow_up_time to complete, the device closes the pipeline mid-speech, causing a
ConnectionResetError on the Home Assistant side and a dropped turn on the device.

This PR handles VOICE_ASSISTANT_STT_VAD_START in the pipeline event switch: when VAD
detects 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

  • Add evSpeaking event kind
  • Handle evSpeaking in handle(): if in a follow-up listening phase, rearm with MaxListen
  • Map VOICE_ASSISTANT_STT_VAD_STARTevSpeaking in pipeline()

Test plan

  • Set follow_up_time to 2 seconds
  • Trigger a voice command, get a response, then speak a follow-up that takes longer than 2 seconds
  • Without this fix: pipeline closes mid-utterance, HA logs ConnectionResetError
  • With this fix: deadline extends to 15s on speech start, follow-up completes normally

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>
@ygelfand

ygelfand commented Sep 4, 2026

Copy link
Copy Markdown
Owner

thx!

@ygelfand
ygelfand merged commit b539584 into ygelfand:main Sep 4, 2026
1 check passed
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.

2 participants