Commit Graph

4 Commits

Author SHA1 Message Date
James Hush
67ea485566 Fix race condition in SpeechTimeoutUserTurnStopStrategy finalized transcript handling
When a finalized transcript arrived after user_speech_timeout had elapsed
from the VAD stop, the strategy would trigger the turn stop immediately
without giving the user time to resume speaking. This happened because
STT processing latency consumed the user_speech_timeout window — by the
time the transcript arrived, the elapsed time check passed even though
the user was still mid-sentence.

The fix removes the immediate early trigger path and instead lets the
original timeout (which includes the STT wait component) complete
naturally. When remaining user_speech_timeout > 0, the timeout is
shortened since STT is done. When it has elapsed, the existing timeout
continues running, providing a buffer for VAD to detect resumed speech.
2026-02-12 12:10:34 +08:00
Mark Backman
34b068d657 Improve user turn stop timing by triggering timeout from VAD stop
Refactor TranscriptionUserTurnStopStrategy and TurnAnalyzerUserTurnStopStrategy
to use VADUserStoppedSpeakingFrame as the ground truth for when speech ended,
rather than triggering timeouts from transcription frames.
2026-02-09 14:12:33 -05:00
Aleix Conchillo Flaqué
305ab44132 tests: add unittest.main() call 2026-01-30 10:07:34 -08:00
Aleix Conchillo Flaqué
4653de9f03 tests: rename test_bot_turn_start_strategy to test_user_turn_stop_strategy 2026-01-09 09:21:28 -08:00