feat: configurable AI channel blocklist (#180)#187
feat: configurable AI channel blocklist (#180)#187BillChirico wants to merge 11 commits intomainfrom
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds a configurable AI channel blocklist so guild admins can prevent AI responses (and triage processing) in selected channels (including threads), with corresponding dashboard UI, config schema updates, and unit tests.
Changes:
- Add
ai.blockedChannelIdsto the web config types and seedconfig.jsondefaults. - Add dashboard UI to edit blocked channels via
ChannelSelector. - Add
isChannelBlocked()helper + message/triage gating in the message-create handler, plus unit tests.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| web/src/types/config.ts | Adds blockedChannelIds to the AiConfig type. |
| web/src/components/dashboard/config-editor.tsx | Adds UI and draft-config updater for selecting blocked channels. |
| src/modules/ai.js | Introduces isChannelBlocked() helper used to enforce the blocklist. |
| src/modules/events.js | Skips AI mention/reply handling and triage accumulation for blocked channels (incl. threads). |
| src/api/utils/configValidation.js | Allows ai.blockedChannelIds in the writable config schema. |
| tests/modules/ai.test.js | Adds unit tests for isChannelBlocked(). |
| config.json | Seeds default ai.blockedChannelIds: [] (plus unrelated encoding-only string changes). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
| Filename | Overview |
|---|---|
| src/modules/ai.js | Added isChannelBlocked() function with proper thread support and error handling |
| src/modules/events.js | Integrated blocklist check before AI responses; correctly handles both mentions and general accumulation |
| tests/modules/ai.test.js | Comprehensive unit tests for isChannelBlocked covering all edge cases including error handling |
| tests/modules/events.test.js | Added integration tests for blocklist in messageCreate handler covering mentions, non-mentions, and threads |
| web/src/components/dashboard/config-editor.tsx | Added ChannelSelector UI for blocklist configuration with proper filtering for text channels only |
Last reviewed commit: dcad790
|
Superseded by #192 - rebased on latest main to resolve BEHIND status. |
Implements configurable AI channel blocklist.
Changes
ai.blockedChannelIdsconfig array (default: [])isChannelBlocked()function with thread supportTesting
Closes #180