From f7012c570cb9997a087aa3ad79785697ac966d4d Mon Sep 17 00:00:00 2001 From: filipi87 Date: Tue, 31 Mar 2026 18:38:11 -0300 Subject: [PATCH] Fixed an issue in the FrameProcessor where only the current frame was checked for being an UninterruptibleFrame, not other frames in the queue. --- src/pipecat/processors/frame_processor.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/pipecat/processors/frame_processor.py b/src/pipecat/processors/frame_processor.py index 8efb1353d..89630b4a7 100644 --- a/src/pipecat/processors/frame_processor.py +++ b/src/pipecat/processors/frame_processor.py @@ -865,9 +865,17 @@ class FrameProcessor(BaseObject): async def _start_interruption(self): """Start handling an interruption by cancelling current tasks.""" try: - if isinstance(self.__process_current_frame, UninterruptibleFrame): - # We don't want to cancel UninterruptibleFrame, so we simply - # cleanup the queue. + current_is_uninterruptible = isinstance( + self.__process_current_frame, UninterruptibleFrame + ) + queue_has_uninterruptible = any( + isinstance(item[0], UninterruptibleFrame) for item in self.__process_queue._queue + ) + if current_is_uninterruptible or queue_has_uninterruptible: + # We don't want to cancel an UninterruptibleFrame (either the + # one currently being processed or one waiting in the queue), + # so we simply cleanup the queue keeping only + # UninterruptibleFrames. self.__reset_process_queue() else: # Cancel and re-create the process task.