From 0839b48da836faee2b20ec8c3b8400351d4855ad Mon Sep 17 00:00:00 2001 From: Paul Kompfner Date: Fri, 12 Sep 2025 14:41:54 -0400 Subject: [PATCH] Fix an issue where the upstream `ServiceSwitcherFilter` wouldn't get updated with the current active service --- src/pipecat/pipeline/service_switcher.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pipecat/pipeline/service_switcher.py b/src/pipecat/pipeline/service_switcher.py index b8b1e7c41..8dc7c0362 100644 --- a/src/pipecat/pipeline/service_switcher.py +++ b/src/pipecat/pipeline/service_switcher.py @@ -112,6 +112,11 @@ class ServiceSwitcher(ParallelPipeline, Generic[StrategyType]): """Process a frame through the filter, handling special internal filter-updating frames.""" if isinstance(frame, ServiceSwitcher.ServiceSwitcherFilterFrame): self.active_service = frame.active_service + # Two ServiceSwitcherFilters "sandwich" a service. Push the + # frame only to update the other side of the sandwich, but + # otherwise don't let it leave the sandwich. + if direction == self._direction: + await self.push_frame(frame, direction) return await super().process_frame(frame, direction)