From 2a8f4734e08ddc77bd68dcc4f5d62909503c4231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Thu, 30 Apr 2026 16:31:29 -0700 Subject: [PATCH] refactor(user_mute): remove unused reset() method from strategies The reset() method on BaseUserMuteStrategy and its subclasses was never called anywhere in the codebase. --- src/pipecat/turns/user_mute/always_user_mute_strategy.py | 4 ---- src/pipecat/turns/user_mute/base_user_mute_strategy.py | 4 ---- .../turns/user_mute/first_speech_user_mute_strategy.py | 5 ----- .../turns/user_mute/function_call_user_mute_strategy.py | 4 ---- .../mute_until_first_bot_complete_user_mute_strategy.py | 4 ---- 5 files changed, 21 deletions(-) diff --git a/src/pipecat/turns/user_mute/always_user_mute_strategy.py b/src/pipecat/turns/user_mute/always_user_mute_strategy.py index 981c6bb74..d566f5bc9 100644 --- a/src/pipecat/turns/user_mute/always_user_mute_strategy.py +++ b/src/pipecat/turns/user_mute/always_user_mute_strategy.py @@ -18,10 +18,6 @@ class AlwaysUserMuteStrategy(BaseUserMuteStrategy): super().__init__() self._bot_speaking = False - async def reset(self): - """Reset the strategy to its initial state.""" - self._bot_speaking = False - async def process_frame(self, frame: Frame) -> bool: """Process an incoming frame. diff --git a/src/pipecat/turns/user_mute/base_user_mute_strategy.py b/src/pipecat/turns/user_mute/base_user_mute_strategy.py index 67aaa2867..2124105fc 100644 --- a/src/pipecat/turns/user_mute/base_user_mute_strategy.py +++ b/src/pipecat/turns/user_mute/base_user_mute_strategy.py @@ -51,10 +51,6 @@ class BaseUserMuteStrategy(BaseObject): """Cleanup the strategy.""" pass - async def reset(self): - """Reset the strategy to its initial state.""" - pass - async def process_frame(self, frame: Frame) -> bool: """Process an incoming frame. diff --git a/src/pipecat/turns/user_mute/first_speech_user_mute_strategy.py b/src/pipecat/turns/user_mute/first_speech_user_mute_strategy.py index 9349edd11..324213f82 100644 --- a/src/pipecat/turns/user_mute/first_speech_user_mute_strategy.py +++ b/src/pipecat/turns/user_mute/first_speech_user_mute_strategy.py @@ -29,11 +29,6 @@ class FirstSpeechUserMuteStrategy(BaseUserMuteStrategy): self._bot_speaking = False self._first_speech_handled = False - async def reset(self): - """Reset the strategy to its initial state.""" - self._bot_speaking = False - self._first_speech_handled = False - async def process_frame(self, frame: Frame) -> bool: """Process an incoming frame. diff --git a/src/pipecat/turns/user_mute/function_call_user_mute_strategy.py b/src/pipecat/turns/user_mute/function_call_user_mute_strategy.py index fa2aa6b71..5549ffd6a 100644 --- a/src/pipecat/turns/user_mute/function_call_user_mute_strategy.py +++ b/src/pipecat/turns/user_mute/function_call_user_mute_strategy.py @@ -30,10 +30,6 @@ class FunctionCallUserMuteStrategy(BaseUserMuteStrategy): super().__init__() self._function_call_in_progress: set[str] = set() - async def reset(self): - """Reset the strategy to its initial state.""" - self._function_call_in_progress = set() - async def process_frame(self, frame: Frame) -> bool: """Process an incoming frame. diff --git a/src/pipecat/turns/user_mute/mute_until_first_bot_complete_user_mute_strategy.py b/src/pipecat/turns/user_mute/mute_until_first_bot_complete_user_mute_strategy.py index c19499e07..2f76b559c 100644 --- a/src/pipecat/turns/user_mute/mute_until_first_bot_complete_user_mute_strategy.py +++ b/src/pipecat/turns/user_mute/mute_until_first_bot_complete_user_mute_strategy.py @@ -30,10 +30,6 @@ class MuteUntilFirstBotCompleteUserMuteStrategy(BaseUserMuteStrategy): super().__init__() self._first_speech_handled = False - async def reset(self): - """Reset the strategy to its initial state.""" - self._first_speech_handled = False - async def process_frame(self, frame: Frame) -> bool: """Process an incoming frame.