remove debug statements
This commit is contained in:
@@ -59,11 +59,9 @@ fn get_todo_path() -> std::path::PathBuf {
|
||||
fn get_logs_dir() -> std::path::PathBuf {
|
||||
if let Ok(workspace_path) = std::env::var("G3_WORKSPACE_PATH") {
|
||||
let logs_path = std::path::PathBuf::from(workspace_path).join("logs");
|
||||
eprintln!("[DEBUG] get_logs_dir: Using G3_WORKSPACE_PATH, logs_path={}", logs_path.display());
|
||||
logs_path
|
||||
} else {
|
||||
let logs_path = std::env::current_dir().unwrap_or_default().join("logs");
|
||||
eprintln!("[DEBUG] get_logs_dir: G3_WORKSPACE_PATH not set, using current dir, logs_path={}", logs_path.display());
|
||||
logs_path
|
||||
}
|
||||
}
|
||||
|
||||
@@ -312,9 +312,6 @@ pub async fn call_refinement_llm_with_tools(
|
||||
codepath: &str,
|
||||
workspace: &str,
|
||||
) -> Result<String> {
|
||||
eprintln!("[DEBUG] call_refinement_llm_with_tools: codepath={}, workspace={}",
|
||||
codepath, workspace);
|
||||
|
||||
// Build system message with codepath context
|
||||
let system_prompt = prompts::REFINE_REQUIREMENTS_SYSTEM_PROMPT
|
||||
.replace("<codepath>", codepath);
|
||||
@@ -331,17 +328,11 @@ pub async fn call_refinement_llm_with_tools(
|
||||
// The codepath is where the source code lives (e.g., ~/RustroverProjects/g3)
|
||||
// Previous bug: was using codepath as workspace, causing logs to go to wrong location
|
||||
let workspace_path = std::path::PathBuf::from(workspace);
|
||||
eprintln!("[DEBUG] Creating Project with workspace_path={}", workspace_path.display());
|
||||
|
||||
let project = Project::new(workspace_path.clone());
|
||||
project.ensure_workspace_exists()?;
|
||||
project.enter_workspace()?;
|
||||
|
||||
// CRITICAL: Ensure logs directory exists BEFORE creating Agent
|
||||
// This guarantees <workspace>/logs/ directory is ready for log writes
|
||||
project.ensure_logs_dir()?;
|
||||
eprintln!("[DEBUG] Logs directory created/verified: {}", project.logs_dir().display());
|
||||
|
||||
// Create agent - not autonomous mode, just regular agent with tools
|
||||
let mut agent = Agent::new_with_readme_and_quiet(
|
||||
planner_config,
|
||||
@@ -351,9 +342,6 @@ pub async fn call_refinement_llm_with_tools(
|
||||
)
|
||||
.await?;
|
||||
|
||||
eprintln!("[DEBUG] Agent created, G3_WORKSPACE_PATH should be: {}",
|
||||
std::env::var("G3_WORKSPACE_PATH").unwrap_or_else(|_| "NOT SET".to_string()));
|
||||
|
||||
// Execute the refinement task
|
||||
// The agent will have access to tools and execute them
|
||||
let task = user_message;
|
||||
|
||||
@@ -724,7 +724,6 @@ pub async fn run_planning_mode(
|
||||
|
||||
// Set G3_WORKSPACE_PATH environment variable EARLY for all logging
|
||||
std::env::set_var("G3_WORKSPACE_PATH", workspace_dir.display().to_string());
|
||||
eprintln!("[DEBUG] Set G3_WORKSPACE_PATH={}", workspace_dir.display());
|
||||
|
||||
// Create logs directory and verify it exists
|
||||
let logs_dir = workspace_dir.join("logs");
|
||||
@@ -733,7 +732,6 @@ pub async fn run_planning_mode(
|
||||
.context("Failed to create logs directory")?;
|
||||
}
|
||||
print_msg(&format!("📁 Logs directory: {}", logs_dir.display()));
|
||||
eprintln!("[DEBUG] Logs directory created/verified: {}", logs_dir.display());
|
||||
|
||||
// Create the LLM provider for planning
|
||||
print_msg("🔧 Initializing planner provider...");
|
||||
@@ -785,9 +783,6 @@ pub async fn run_planning_mode(
|
||||
let codepath_str = config.codepath.display().to_string();
|
||||
let workspace_str = workspace_dir.display().to_string();
|
||||
|
||||
eprintln!("[DEBUG] Calling refinement with codepath={}, workspace={}",
|
||||
codepath_str, workspace_str);
|
||||
|
||||
// Load config and call LLM with full tool execution capability
|
||||
let g3_config = g3_config::Config::load(config.config_path.as_deref())?;
|
||||
let response = llm::call_refinement_llm_with_tools(
|
||||
|
||||
Reference in New Issue
Block a user