diff --git a/modules/features/teamsbot/service.py b/modules/features/teamsbot/service.py index 6a9db449..42065c78 100644 --- a/modules/features/teamsbot/service.py +++ b/modules/features/teamsbot/service.py @@ -684,11 +684,11 @@ class TeamsbotService: logger.debug(f"Session {sessionId}: Chat history stored (no AI trigger): [{speaker}] {text[:60]}") return - # Filter out the bot's own speech entirely — captions of the bot's - # own voice come back as garbled text (e.g. German TTS → English caption) - # which pollutes the context buffer and confuses AI analysis. + # Filter out the bot's own speech (caption/audioCapture) — garbled text + # pollutes context. Chat from the bot is clean text and must appear in + # the transcript for all participants. isBotSpeaker = self._isBotSpeaker(speaker) - if isBotSpeaker: + if isBotSpeaker and source != "chat": logger.debug(f"Session {sessionId}: Ignoring own bot caption from: [{speaker}] {text[:80]}...") return @@ -778,6 +778,10 @@ class TeamsbotService: if self.config.responseMode == TeamsbotResponseMode.TRANSCRIBE_ONLY: return + # Bot's own chat: stored for display only, never trigger AI + if source == "chat" and isBotSpeaker: + return + # Stop phrases: trigger immediately without debounce (root cause: 3s debounce delayed stop) if self._isStopPhrase(text): logger.info(f"Session {sessionId}: Stop phrase detected, triggering analysis immediately")