From 8a39461b21c1eb63ee9b0cc5fe8233dba21eb7ab Mon Sep 17 00:00:00 2001 From: Xin Wang Date: Mon, 1 Jun 2026 08:41:00 +0800 Subject: [PATCH] fix duplicate assistant text events --- engine/product_protocol.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/engine/product_protocol.py b/engine/product_protocol.py index bce39dc..77d781e 100644 --- a/engine/product_protocol.py +++ b/engine/product_protocol.py @@ -18,7 +18,6 @@ from pipecat.frames.frames import ( OutputAudioRawFrame, OutputTransportMessageFrame, OutputTransportMessageUrgentFrame, - TextFrame, TranscriptionFrame, UserImageRawFrame, ) @@ -64,9 +63,9 @@ class ProductWebsocketSerializer(FrameSerializer): timestamp=frame.timestamp, ) - if isinstance(frame, TextFrame): - return self._event("response.text.delta", text=frame.text) - + # ProductTextStreamProcessor owns response.text.* events. TTS also + # emits TextFrame subclasses internally, and serializing those here + # would make the UI render duplicate assistant bubbles. if isinstance(frame, (OutputTransportMessageFrame, OutputTransportMessageUrgentFrame)): if self.should_ignore_frame(frame): return None