fix: preserve skip_tts flag when frames pass through LLM services

Only set skip_tts=True when _skip_tts is configured, rather than
unconditionally overwriting the frame's skip_tts value. This preserves
frames that already have skip_tts=True when passing through LLM services.

Fixes issue where LLMTextFrame with skip_tts=True would exit LLMSwitcher
with skip_tts=False.
This commit is contained in:
James Hush
2025-11-28 13:54:57 +01:00
parent d486c80804
commit 4f89c99199

View File

@@ -292,8 +292,11 @@ class LLMService(AIService):
frame: The frame to push.
direction: The direction of frame pushing.
"""
# Only set skip_tts=True when configured, to preserve frames that already
# have skip_tts=True. This avoids overwriting frames passing through.
if isinstance(frame, (LLMTextFrame, LLMFullResponseStartFrame, LLMFullResponseEndFrame)):
frame.skip_tts = self._skip_tts
if self._skip_tts:
frame.skip_tts = True
await super().push_frame(frame, direction)