From ba0ddb1832a62297c214e4f60fcf5235cf933a04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Wed, 21 Jan 2026 18:05:15 -0800 Subject: [PATCH] FrameProcessor: copy kwargs when broadcasting frame --- src/pipecat/processors/frame_processor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pipecat/processors/frame_processor.py b/src/pipecat/processors/frame_processor.py index 10aafc5a8..1ad57e0d6 100644 --- a/src/pipecat/processors/frame_processor.py +++ b/src/pipecat/processors/frame_processor.py @@ -781,14 +781,14 @@ class FrameProcessor(BaseObject): frame_cls: The class of the frame to be broadcasted. **kwargs: Keyword arguments to be passed to the frame's constructor. """ - await self.push_frame(frame_cls(**kwargs)) - await self.push_frame(frame_cls(**kwargs), FrameDirection.UPSTREAM) + await self.push_frame(frame_cls(**deepcopy(kwargs))) + await self.push_frame(frame_cls(**deepcopy(kwargs)), FrameDirection.UPSTREAM) async def broadcast_frame_instance(self, frame: Frame): """Broadcasts a frame instance upstream and downstream. - This method extracts the class and init fields from the given frame - instance and creates two new instances to push upstream and downstream. + This method creates two new frame instances copying all fields from the + original frame except `id` and `name`, which get fresh values. Args: frame: The frame instance to broadcast.