teamsbot: Bot-Chat im Transcript, keine AI-Trigger auf eigene Chat-Nachrichten

Made-with: Cursor
This commit is contained in:
patrick-motsch 2026-03-06 12:40:06 +01:00
parent d7ba24f61a
commit c76f2c44f2

View file

@ -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")