Fix LLMUserAggregator broadcasting mute events before StartFrame
This commit is contained in:
@@ -549,6 +549,15 @@ class LLMUserAggregator(LLMContextAggregator):
|
||||
await s.cleanup()
|
||||
|
||||
async def _maybe_mute_frame(self, frame: Frame):
|
||||
# Control frames must flow unconditionally — never feed them to mute
|
||||
# strategies. Without this guard, strategies like
|
||||
# MuteUntilFirstBotCompleteUserMuteStrategy fire on_user_mute_started
|
||||
# and broadcast UserMuteStartedFrame before StartFrame is pushed
|
||||
# downstream, causing downstream processors to receive frames before
|
||||
# StartFrame and log errors.
|
||||
if isinstance(frame, (StartFrame, EndFrame, CancelFrame)):
|
||||
return False
|
||||
|
||||
should_mute_frame = self._user_is_muted and isinstance(
|
||||
frame,
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user