Skip to content

feat(interruption): 1s barge-in holdoff window for VAD interruptions#5269

Open
chenghao-mou wants to merge 2 commits intomainfrom
ch/bargein-warmup
Open

feat(interruption): 1s barge-in holdoff window for VAD interruptions#5269
chenghao-mou wants to merge 2 commits intomainfrom
ch/bargein-warmup

Conversation

@chenghao-mou
Copy link
Copy Markdown
Member

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.

…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).
@chenghao-mou chenghao-mou requested a review from a team March 29, 2026 18:26
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 3 additional findings in Devin Review.

Open in Devin Review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟑 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)

Open in Devin Review

Was this helpful? React with πŸ‘ or πŸ‘Ž to provide feedback.

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.

1 participant