-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
DiffScope reviews every changed file with the same model and depth. CodeRabbit uses a cheap model to classify each file as NEEDS_REVIEW or APPROVED (cosmetic/formatting change) before spending expensive model tokens. This reduces cost and noise significantly.
How CodeRabbit Does It
- A lightweight model classifies each changed file:
- "Does this file contain logic/functionality changes, or is it purely cosmetic/formatting?"
- Classification:
NEEDS_REVIEWorAPPROVED
- Files classified as
APPROVEDskip the detailed review entirely - Rate limits: Free=150 files max, Pro=300 files max
How Qodo Does It
- Files sorted by main language first, then by token count descending
patch_extension_skip_types = [".md", ".txt"]— certain file types auto-skipped- Deletion-only hunks removed via
omit_deletion_hunks()before the expensive call
Proposed Solution
Add a triage step before the main review:
Implementation
#[derive(Debug)]
enum TriageResult {
NeedsReview, // Logic/functionality change — full review
Cosmetic, // Formatting, whitespace, comments-only — skip
ConfigChange, // Config/env changes — lightweight review
TestOnly, // Test changes — review with different rules
DeletionOnly, // File deleted or lines-only removed — skip
Generated, // Auto-generated code — skip
}
async fn triage_file(
diff: &UnifiedDiff,
model: &ModelConfig, // use weak/cheap model
) -> TriageResult {
// Heuristic checks first (no LLM needed):
// - All-whitespace changes → Cosmetic
// - Deletion-only hunks → DeletionOnly
// - Known generated file patterns → Generated
// - Lock files, vendor dirs → Generated
// LLM classification for ambiguous cases:
// - "Is this a logic change or purely cosmetic?"
// - Use cheap model (Haiku, GPT-4o-mini)
}Heuristic-Only Triage (no LLM cost)
Many files can be triaged without any LLM call:
- Lock files (
Cargo.lock,package-lock.json,yarn.lock) - Generated code (
.generated.,_generated/) - Binary files
- Deletion-only changes
- Whitespace-only changes
- Comment-only changes (parse for
//,#,/* */patterns)
Configuration
triage:
enabled: true
model: null # null = use weak model, or specify explicitly
skip_patterns:
- "*.lock"
- "*.generated.*"
- "vendor/**"
auto_approve:
- deletion_only: true
- whitespace_only: true
- comment_only: trueExpected Impact
- 30-50% fewer files sent to the expensive review model
- Faster review times
- Less noise (no comments on formatting/lock file changes)
- Ties into multi-model routing (Multi-model routing: triage with cheap models, review with frontier #26) — triage uses cheap model
Priority
Medium — cost and noise reduction. Quick win that compounds with scale.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request