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
+7 -1
View File
@@ -194,11 +194,17 @@ pub fn build_workspace_tree(root: &Path, max_files: usize) -> String {
// Rich Context Builder
// ---------------------------------------------------------------------------
/// Gathers essential project context (OS, Time, Git, Tech Stack, Rules) into a string.
/// Gathers essential project context (OS, Time, PWD, Git, Tech Stack, Rules) into a string.
pub fn build_rich_context(root: &Path) -> String {
use std::process::Command;
let mut ctx = String::new();
// 0. Current working directory (PWD)
let cwd = std::env::current_dir()
.map(|p| p.to_string_lossy().to_string())
.unwrap_or_else(|_| "unknown".to_string());
ctx.push_str(&format!("### Current Directory (PWD)\n`{cwd}`\n\n"));
// 1. Time and OS
let os = std::env::consts::OS;
let arch = std::env::consts::ARCH;