feat: implement OOD query filtering in bot logic and enforce scoped i…#11
feat: implement OOD query filtering in bot logic and enforce scoped i…#11kpj2006 wants to merge 3 commits into
Conversation
…nteraction guidelines via .clinerules
|
Warning Review limit reached
More reviews will be available in 35 minutes and 51 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. WalkthroughAdds an out-of-domain query guard to ChangesOOD Query Guard and Thread Channel Routing
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@bot.py`:
- Around line 166-182: The is_query_covered function currently checks if
keywords exist in either the current query or the entire conversation context
history, which allows past in-domain messages to incorrectly mark a new
out-of-domain query as covered. Remove the context checking from the keyword
matching logic in the is_query_covered function by changing the condition that
currently checks both query and context to only check the current query. This
ensures coverage determination is based solely on the current user query and not
the entire thread history.
- Around line 166-182: The keyword matching in the is_query_covered function
uses simple substring checks (kw in q and kw in ctx) which cause false positives
with short keywords like "pr" matching unrelated words like "price". Replace the
substring matching logic with word boundary checking to ensure only complete
words are matched, not partial substrings. Consider using regular expressions
with word boundaries (\b) to check if each keyword in the categories dictionary
appears as a whole word in the query or context strings rather than allowing
arbitrary substring matches.
- Around line 192-196: In the is_in_configured_channel assignment, replace the
attribute access `message.channel.parent.id` with `message.channel.parent_id`
when is_in_thread is true. The parent attribute can be None when the parent
channel is unavailable in the client cache (in discord.py 2.3.2), which causes
an AttributeError when dereferencing .id. The parent_id attribute is always
stable and available, so use that instead for the channel ID comparison.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 8e50c4d3-a666-4955-8623-21261ec8842a
📒 Files selected for processing (2)
.clinerulesbot.py
…improve LLM prompt context inclusion
…nteraction guidelines via .clinerules
Addressed Issues:
Fixes #(issue number)
Screenshots/Recordings:
Additional Notes:
Checklist
We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.
Summary by CodeRabbit
New Features
Bug Fixes