From 050ecc7a2d1f2c4f613f1630674e9c0cb1cac94b Mon Sep 17 00:00:00 2001 From: Xin Wang Date: Fri, 29 May 2026 16:05:23 +0800 Subject: [PATCH] Fix idle and text input race bug --- engine/text_input.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/engine/text_input.py b/engine/text_input.py index c205468..f9b5c4e 100644 --- a/engine/text_input.py +++ b/engine/text_input.py @@ -2,7 +2,13 @@ from __future__ import annotations from loguru import logger -from pipecat.frames.frames import Frame, InputTransportMessageFrame, LLMMessagesAppendFrame +from pipecat.frames.frames import ( + Frame, + InputTransportMessageFrame, + LLMMessagesAppendFrame, + UserStartedSpeakingFrame, + UserStoppedSpeakingFrame, +) from pipecat.processors.frame_processor import FrameDirection, FrameProcessor @@ -25,6 +31,8 @@ class ProductTextInputProcessor(FrameProcessor): if not text: return + await self.broadcast_frame(UserStartedSpeakingFrame) + if message.get("interrupt", True): logger.info("Text input interrupting current response") await self.broadcast_interruption() @@ -36,4 +44,4 @@ class ProductTextInputProcessor(FrameProcessor): ), FrameDirection.DOWNSTREAM, ) - + await self.broadcast_frame(UserStoppedSpeakingFrame)