feat(interruption): 1s barge-in holdoff window for VAD interruptions#5269
feat(interruption): 1s barge-in holdoff window for VAD interruptions#5269chenghao-mou wants to merge 2 commits intomainfrom
Conversation
β¦n during agent speech start Allow VAD interruptions during the first second of the agent speech, while keeping adaptive interruption running (results are ignored until the timer expires).
There was a problem hiding this comment.
π‘ Holdoff timer not cancelled in AudioRecognition.aclose()
The _interruption_holdoff_timer (asyncio.TimerHandle) is not cancelled in AudioRecognition.aclose() (audio_recognition.py:492). The stop() method (which would cancel it via update_interruption_detection(None) β cancel_interruption_holdoff()) is never called on the aclose() path β agent_activity.py:841-842 calls aclose() directly. If the agent is mid-speech when the session closes, the holdoff timer can fire after aclose() completes, executing the _disable_vad callback which accesses self._session.agent_state and mutates self._interruption_by_audio_activity_enabled on a closed activity.
(Refers to lines 492-514)
Was this helpful? React with π or π to provide feedback.
This PR allows VAD interruptions during the first second (configurable) of the agent's speech, while keeping adaptive interruption running (results are ignored until the timer expires).
This is useful for incorrect end of turn predictions or change-of-mind speeches.