icy-nightfall-64225
07/21/2025, 4:23 PMraise RuntimeError("This generation handle does not allow interruptions")tall-airline-16756
07/21/2025, 4:23 PMtall-airline-16756
07/21/2025, 4:24 PMraise RuntimeError("This generation handle does not allow interruptions") occurs when you attempt to interrupt a speech or generation handle that was created with allow_interruptions=False. This setting prevents interruptions for critical speech segments.
To allow interruptions, ensure that you set allow_interruptions=True when creating the speech handle. For example:
await session.say("This speech can be interrupted", allow_interruptions=True)
If you need to change this setting on an existing handle, you can set:
handle.allow_interruptions = True
For cascaded or realtime models with server-side turn detection, interruptions are always enabled and you cannot set allow_interruptions=False. If you require non-interruptible speech in these cases, you must disable server-side turn detection and use VAD instead.
Before attempting to interrupt, check if the current speech handle allows interruptions:
if session.current_speech and not session.current_speech.allow_interruptions:
print("Current speech cannot be interrupted")
Set allow_interruptions=True before calling interrupt() to avoid this error.
Sources: livekit-agents/livekit/agents/voice/events.py | Agent speech and audio | LiveKit Docsicy-nightfall-64225
07/21/2025, 4:29 PMself.session.commit_user_turn. After that, I tried self.session.interrupt() and the log says
WARNING livekit.agents - 2025-07-22 01:28:35,062 - WARNING livekit.agents - skipping reply to user input, current speech generation cannot be interrupted
How can I interrupt the speech generated by commit_user_turn? I am using cascaded modeltall-airline-16756
07/21/2025, 4:31 PMcommit_user_turn. It's pretty straightforward – by default, it follows the session or agent's allow_interruptions setting. If interruptions aren't allowed, any attempts to interrupt will be quietly skipped with a quick warning.
Want to make sure you can interrupt speech smoothly in a cascaded model? I've got you covered with a few friendly approaches:
• Set allow_interruptions=True at the session or agent level when you're creating your session. This makes all generated speech – including from commit_user_turn – totally interruptible:
session = AgentSession(allow_interruptions=True, ...)
• Manually enable interruptions on the current speech handle right before you want to interrupt: if session.current_speech:
session.current_speech.allow_interruptions = True
session.interrupt()
• Manual interruption via session.interrupt() is always an option, no matter what the allow_interruptions setting says. This will stop the current speech and any speech waiting in line.
Pro tip: For the most reliable interruption after commit_user_turn, I recommend either setting allow_interruptions=True in your session config or quickly updating the current speech handle's allow_interruptions property before interrupting. Easy peasy!
Sources: Agent speech and audio | LiveKit Docs | livekit-agents/livekit/agents/voice/agent_activity.py | VoicePipelineAgent | LiveKit Docsicy-nightfall-64225
07/21/2025, 4:34 PMself.session.commit_user_turn(
transcript_timeout=20
)
if self.session.current_speech:
self.session._activity._current_speech.allow_interruptions = True
self.session.interrupt()
await self.session.generate_reply(
user_input=NOT_GIVEN, # no user input in cascaded model to work correctly
instructions="Generate an interruption script because the user is speaking too long. ",
tool_choice=tool_choice,
allow_interruptions=False, # has to be False for cascaded API to work correctly
)
The error is still the same as above. Not easy peasytall-airline-16756
07/21/2025, 4:34 PMicy-nightfall-64225
07/21/2025, 4:36 PM