feat: refactor agent step limits and enhance workflow orchestration with new findings tool

This commit is contained in:
asepharyana
2026-07-13 14:39:39 +07:00
parent 0d6f558b2b
commit 3b660e09a8
9 changed files with 229 additions and 100 deletions
+4 -11
View File
@@ -37,12 +37,6 @@ const SKIP_REVIEW_FILES: &[&str] = &[
".gitignore", ".env", ".env.example",
];
/// Maximum LLM steps for a quick-review subagent. Keeps reviews fast.
const QUICK_REVIEW_MAX_STEPS: usize = 2;
/// Maximum LLM steps for background subagents (test gen, arch, security).
const BG_SUBAGENT_MAX_STEPS: usize = 8;
/// ─── Helpers ───
///
/// Check whether a file path is worth auto-reviewing (not config/lock/data).
@@ -114,8 +108,7 @@ pub fn spawn_quick_review(
"quick-reviewer".to_string(),
"reviewer".to_string(),
)
.with_system_prompt(prompt)
.with_max_steps(QUICK_REVIEW_MAX_STEPS);
.with_system_prompt(prompt);
let mut ctx = build_subagent_context(&def);
ctx.session_dir = session_dir.to_path_buf();
@@ -189,7 +182,7 @@ pub fn spawn_background_test_gen(
"coder".to_string(), // needs write access
)
.with_system_prompt(prompt)
.with_max_steps(BG_SUBAGENT_MAX_STEPS);
;
let mut ctx = build_subagent_context(&def);
ctx.session_dir = sd;
@@ -269,7 +262,7 @@ pub fn spawn_background_arch_review(
"reviewer".to_string(),
)
.with_system_prompt(prompt)
.with_max_steps(BG_SUBAGENT_MAX_STEPS);
;
let mut ctx = build_subagent_context(&def);
ctx.session_dir = sd;
@@ -355,7 +348,7 @@ pub fn spawn_background_security_review(
"reviewer".to_string(),
)
.with_system_prompt(prompt)
.with_max_steps(BG_SUBAGENT_MAX_STEPS);
;
let mut ctx = build_subagent_context(&def);
ctx.session_dir = sd;