From c76f2c44f22e8f52585c6af2e787cf9acd098753 Mon Sep 17 00:00:00 2001
From: patrick-motsch
Date: Fri, 6 Mar 2026 12:40:06 +0100
Subject: [PATCH] teamsbot: Bot-Chat im Transcript, keine AI-Trigger auf eigene
Chat-Nachrichten
Made-with: Cursor
---
modules/features/teamsbot/service.py | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
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")