feat: enhance context gathering in auto-review engine and agent runner

This commit is contained in:
asepharyana
2026-07-20 17:32:31 +07:00
parent 289c58ef36
commit dcc8c3ee42
4 changed files with 183 additions and 105 deletions
+13 -1
View File
@@ -41,8 +41,20 @@ pub async fn run_agent(
let tools = tools_for(&access);
let defs = tool_defs(&tools);
let cwd = std::env::current_dir()
.map(|p| p.to_string_lossy().to_string())
.unwrap_or_else(|_| "unknown".to_string());
let ws_root = tool_ctx
.workspaces
.first()
.map(|p| p.to_string_lossy().to_string())
.unwrap_or_else(|| cwd.clone());
let mut messages = vec![ChatMessage::system(format!(
"You are a focused subagent.\n\nYour directive:\n{directive}\n\n\
"You are a focused subagent.\n\n\
Current directory (PWD): {cwd}\n\
Workspace root: {ws_root}\n\n\
Your directive:\n{directive}\n\n\
Complete the directive autonomously using the tools available to you. \
Return your final answer when done."
))];