Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .changeset/adaptive-interruption-overlap-state.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
'@livekit/agents': patch
---

fix(interruption): keep adaptive interruption armed when agent speech restarts mid-overlap

`overlapSpeechStarted` is the gate that lets a user's overlapping audio reach the interruption
model, and only a VAD start-of-speech raises it. Two events cleared it while the user was still
talking, and because VAD never re-announces speech that is already under way, nothing could re-arm
it for the rest of the agent turn: every remaining frame was dropped, no inference request was
made, and the agent talked straight through the interruption.

- A transport failover rebuilt `InterruptionStreamBase` from scratch and replayed only
`agent-speech-started`, which marks the agent as speaking but leaves the overlap disarmed. The
in-progress overlap is now handed to the replacement stream.
- A second speech segment in the same turn (a queued `SpeechHandle`, or the reply after a tool
call) raises `agent-speech-started` again with no `agent-speech-ended` in between, and was
treated as a new turn. An open overlap is now preserved across it; a genuine new turn still
resets the overlap, audio buffer, cache and counters.

Also stops a rejected forwarding task from surfacing as an unhandled rejection during the failover
backoff.
Loading
Loading