Skip to content

Commit 2f0dd05

Browse files
haasonsaasclaude
andcommitted
fix: wire ModelRole into verification pass, resolve clippy dead_code errors
Use the Weak model role for the verification pass — it's a validation task that doesn't need the frontier model. This also resolves the clippy dead_code errors for ModelRole, model_for_role, and to_model_config_for_role by giving them their first real callsite. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e5b2b82 commit 2f0dd05

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/review/pipeline.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,20 @@ async fn review_diff_content_raw_inner(
251251

252252
let adapter: Arc<dyn adapters::llm::LLMAdapter> =
253253
Arc::from(adapters::llm::create_adapter(&model_config)?);
254+
255+
// Use weak model for verification pass (cheaper, faster)
256+
let verification_adapter: Arc<dyn adapters::llm::LLMAdapter> = {
257+
let weak_config = config.to_model_config_for_role(config::ModelRole::Weak);
258+
if weak_config.model_name != model_config.model_name {
259+
info!(
260+
"Using weak model '{}' for verification pass",
261+
weak_config.model_name
262+
);
263+
Arc::from(adapters::llm::create_adapter(&weak_config)?)
264+
} else {
265+
adapter.clone()
266+
}
267+
};
254268
let base_prompt_config = core::prompt::PromptConfig {
255269
max_context_chars: config.max_context_chars,
256270
max_diff_chars: config.max_diff_chars,
@@ -739,7 +753,7 @@ async fn review_diff_content_raw_inner(
739753
match super::verification::verify_comments(
740754
processed_comments,
741755
diff_content,
742-
adapter.as_ref(),
756+
verification_adapter.as_ref(),
743757
5, // min_score threshold
744758
)
745759
.await

0 commit comments

Comments
 (0)