feat: enhance context gathering in auto-review engine and agent runner
This commit is contained in:
@@ -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."
|
||||
))];
|
||||
|
||||
Reference in New Issue
Block a user