Skip to content

Commit d774d26

Browse files
authored
force interruption when closing the session (#4346)
1 parent 87e9807 commit d774d26

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

livekit-agents/livekit/agents/voice/agent_session.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -767,11 +767,10 @@ async def _aclose_impl(
767767
if self._activity is not None:
768768
if not drain:
769769
try:
770-
await self._activity.interrupt()
770+
# force interrupt speeches when closing the session
771+
await self._activity.interrupt(force=True)
771772
except RuntimeError:
772773
# uninterruptible speech
773-
# TODO(long): force interrupt or wait for it to finish?
774-
# it might be an audio played from the error callback
775774
pass
776775
await self._activity.drain()
777776

0 commit comments

Comments
 (0)