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.
20 KiB
20 KiB