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
5 changes: 4 additions & 1 deletion livekit-agents/livekit/agents/voice/agent_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,10 @@ async def _user_turn_completed_task(
user_message=user_message, chat_ctx=temp_mutable_chat_ctx
)

if self._user_turn_completed_atask != asyncio.current_task():
if (
self._user_turn_completed_atask != asyncio.current_task()
and not speech_handle._allow_interruptions
Copy link
Contributor

Choose a reason for hiding this comment

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

should we cancel the speech in this case? cc @theomonnom

Copy link
Member

Choose a reason for hiding this comment

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

IMO manual interruption should always be allowed..

allow_interruption should be referencing if a user is able to interrupt via voice

Copy link
Member

@theomonnom theomonnom Aug 29, 2025

Choose a reason for hiding this comment

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

Another PR added force=True to the interrupt method.

Copy link
Member

Choose a reason for hiding this comment

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

Otherwise I think this PR makes sense, but shouldn't it be the opposite? We check if interruptions is allowed, not disallowed

):
# If a new user turn has already started, interrupt this one since it's now outdated
# (We still create the SpeechHandle and the generate_reply coroutine, otherwise we may
# lose data like the beginning of a user speech).
Expand Down
Loading