Skip to content

Don't answer @ai questions that get a badword warning - #5

Merged
raf-li merged 1 commit into
mainfrom
fix/ai-question-badwords
Oct 5, 2026
Merged

raf-li merged 1 commit into
mainfrom
fix/ai-question-badwords

Conversation

@raf-li

@raf-li raf-li commented Oct 5, 2026

Copy link
Copy Markdown
Member

Problem

@ai anjing in a channel got a badword warning by PM, while the AI still answered the question in the channel.

Change

  • An @ai question that is counted as a badword is not answered (nothing is posted in the channel; the usual warning PM is sent).
  • With /abt ai on, a question with only ambiguous words (@ai anjing) is judged by the AI reviewer right away (no 8 s wait for follow-ups), with the earlier messages as context, and the reviewer is told the message is a question to the assistant:
    • ok → not counted, answered
    • insult (e.g. @ai budi itu monyet ya) → counted, not answered
    • reviewer fails or its queue is full → not counted, answered (same "AI failed = not counted" rule)
  • Clear badwords (@ai apa arti kontol) are counted at once and not answered.
  • ai_review.py: prompt rule + two worked examples for questions to the assistant; format_message(..., to_assistant=True) adds a note line.
  • tools/ai_eval.py: 4 @ai question cases (42 total).
  • /help ai, docs/ai.md, CHANGELOG updated.

Testing

  • New scratch suite for this case (27 checks): both switches off, aichat on/ai off, ai on (ok / insult / reviewer failure / queue full), clear and mixed badwords, admins with and without BADWORDS_IGNORE_ADMINS, @aisyah, @ai in a PM, ordinary messages still waiting for follow-ups.
  • All existing scratch suites pass (abuse admin, admin badwords, AI review, AI chat, connections, fixes, prompts, shared accounts, stretched, toggles, wildcards).

🤖 Generated with Claude Code

"@ai anjing" got a badword warning and was still answered by the AI.
A question that is counted is no longer answered. With /abt ai on, a
question with only ambiguous words is judged by the AI right away and
the reviewer is told it is a question to the assistant: asking about a
word is answered, insulting someone in the question is counted and not
answered. If the reviewer fails, the question is not counted and is
answered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@raf-li
raf-li merged commit cb8e377 into main Oct 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant