fix: use enum .value for responseChannel comparison - was silently dropping all responses

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
patrick-motsch 2026-02-18 00:48:41 +01:00
parent a3b771b12a
commit 6963719499

View file

@ -714,9 +714,10 @@ class TeamsbotService:
return
# Determine response channel (voice, chat, or both)
# Normalize to string for reliable comparison (model_copy may skip enum coercion)
channelStr = str(self.config.responseChannel).lower().strip()
logger.info(f"Response channel: '{channelStr}' (raw={self.config.responseChannel!r})")
# Extract the raw value: enum.value gives "voice", str(enum) gives "TeamsbotResponseChannel.voice"
channelRaw = self.config.responseChannel
channelStr = (channelRaw.value if hasattr(channelRaw, 'value') else str(channelRaw)).lower().strip()
logger.info(f"Response channel: '{channelStr}' (raw={channelRaw!r})")
sendVoice = channelStr in ("voice", "both")
sendChat = channelStr in ("chat", "both")