Skip to content
Open
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
8 changes: 1 addition & 7 deletions livekit-agents/livekit/agents/voice/agent_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,13 +671,7 @@ async def _aclose_impl(

if self._activity is not None:
if not drain:
try:
await self._activity.interrupt()
except RuntimeError:
# uninterruptible speech
# TODO(long): force interrupt or wait for it to finish?
# it might be an audio played from the error callback
pass
await self._activity.interrupt(force=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure because the last speech could be an ending/error message that user doesn't want it to be interrupted.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, so should i close this PR, or keep it for now?

await self._activity.drain()

# wait any uninterruptible speech to finish
Expand Down