fix: address multiple bugs found in code review
- Fix dirty-user flush race: discard IDs individually after successful save - Escape LIKE wildcards in LLM-generated topic keywords for DB queries - Anonymize absent-member aliases to prevent LLM de-anonymization - Pass correct MIME type to vision model based on image file extension - Use enumerate instead of list.index() in bcs-scan loop - Allow bot @mentions with non-report intent to fall through to moderation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -273,11 +273,14 @@ class ChatCog(commands.Cog):
|
||||
image_attachment.filename,
|
||||
user_text[:80],
|
||||
)
|
||||
ext = image_attachment.filename.rsplit(".", 1)[-1].lower() if "." in image_attachment.filename else "png"
|
||||
mime = f"image/{'jpeg' if ext == 'jpg' else ext}"
|
||||
response = await self.bot.llm_heavy.analyze_image(
|
||||
image_bytes,
|
||||
IMAGE_ROAST,
|
||||
user_text=user_text,
|
||||
on_first_token=start_typing,
|
||||
media_type=mime,
|
||||
)
|
||||
else:
|
||||
# --- Text-only path: normal chat ---
|
||||
|
||||
Reference in New Issue
Block a user