Silently log LLM failures instead of replying to user

When the LLM is offline, post to #bcs-log instead of sending
the "brain offline" message in chat.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-22 16:55:07 -05:00
parent 85ddba5e4b
commit fd798ce027

View File

@@ -119,7 +119,17 @@ class ChatCog(commands.Cog):
await typing_ctx.__aexit__(None, None, None)
if response is None:
response = "I'd roast you but my brain is offline. Try again later."
log_channel = discord.utils.get(message.guild.text_channels, name="bcs-log")
if log_channel:
try:
await log_channel.send(
f"**LLM OFFLINE** | Failed to generate reply to "
f"{message.author.mention} in #{message.channel.name}"
)
except discord.HTTPException:
pass
logger.warning("LLM returned no response for %s in #%s", message.author, message.channel.name)
return
if not image_attachment:
self._chat_history[ch_id].append(