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 {
|
fn get_logs_dir() -> std::path::PathBuf {
|
||||||
if let Ok(workspace_path) = std::env::var("G3_WORKSPACE_PATH") {
|
if let Ok(workspace_path) = std::env::var("G3_WORKSPACE_PATH") {
|
||||||
let logs_path = std::path::PathBuf::from(workspace_path).join("logs");
|
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
|
logs_path
|
||||||
} else {
|
} else {
|
||||||
let logs_path = std::env::current_dir().unwrap_or_default().join("logs");
|
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
|
logs_path
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -312,9 +312,6 @@ pub async fn call_refinement_llm_with_tools(
|
|||||||
codepath: &str,
|
codepath: &str,
|
||||||
workspace: &str,
|
workspace: &str,
|
||||||
) -> Result<String> {
|
) -> Result<String> {
|
||||||
eprintln!("[DEBUG] call_refinement_llm_with_tools: codepath={}, workspace={}",
|
|
||||||
codepath, workspace);
|
|
||||||
|
|
||||||
// Build system message with codepath context
|
// Build system message with codepath context
|
||||||
let system_prompt = prompts::REFINE_REQUIREMENTS_SYSTEM_PROMPT
|
let system_prompt = prompts::REFINE_REQUIREMENTS_SYSTEM_PROMPT
|
||||||
.replace("<codepath>", codepath);
|
.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)
|
// 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
|
// Previous bug: was using codepath as workspace, causing logs to go to wrong location
|
||||||
let workspace_path = std::path::PathBuf::from(workspace);
|
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());
|
let project = Project::new(workspace_path.clone());
|
||||||
project.ensure_workspace_exists()?;
|
project.ensure_workspace_exists()?;
|
||||||
project.enter_workspace()?;
|
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()?;
|
project.ensure_logs_dir()?;
|
||||||
eprintln!("[DEBUG] Logs directory created/verified: {}", project.logs_dir().display());
|
|
||||||
|
|
||||||
// Create agent - not autonomous mode, just regular agent with tools
|
// Create agent - not autonomous mode, just regular agent with tools
|
||||||
let mut agent = Agent::new_with_readme_and_quiet(
|
let mut agent = Agent::new_with_readme_and_quiet(
|
||||||
planner_config,
|
planner_config,
|
||||||
@@ -351,9 +342,6 @@ pub async fn call_refinement_llm_with_tools(
|
|||||||
)
|
)
|
||||||
.await?;
|
.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
|
// Execute the refinement task
|
||||||
// The agent will have access to tools and execute them
|
// The agent will have access to tools and execute them
|
||||||
let task = user_message;
|
let task = user_message;
|
||||||
|
|||||||
@@ -724,7 +724,6 @@ pub async fn run_planning_mode(
|
|||||||
|
|
||||||
// Set G3_WORKSPACE_PATH environment variable EARLY for all logging
|
// Set G3_WORKSPACE_PATH environment variable EARLY for all logging
|
||||||
std::env::set_var("G3_WORKSPACE_PATH", workspace_dir.display().to_string());
|
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
|
// Create logs directory and verify it exists
|
||||||
let logs_dir = workspace_dir.join("logs");
|
let logs_dir = workspace_dir.join("logs");
|
||||||
@@ -733,7 +732,6 @@ pub async fn run_planning_mode(
|
|||||||
.context("Failed to create logs directory")?;
|
.context("Failed to create logs directory")?;
|
||||||
}
|
}
|
||||||
print_msg(&format!("📁 Logs directory: {}", logs_dir.display()));
|
print_msg(&format!("📁 Logs directory: {}", logs_dir.display()));
|
||||||
eprintln!("[DEBUG] Logs directory created/verified: {}", logs_dir.display());
|
|
||||||
|
|
||||||
// Create the LLM provider for planning
|
// Create the LLM provider for planning
|
||||||
print_msg("🔧 Initializing planner provider...");
|
print_msg("🔧 Initializing planner provider...");
|
||||||
@@ -785,9 +783,6 @@ pub async fn run_planning_mode(
|
|||||||
let codepath_str = config.codepath.display().to_string();
|
let codepath_str = config.codepath.display().to_string();
|
||||||
let workspace_str = workspace_dir.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
|
// Load config and call LLM with full tool execution capability
|
||||||
let g3_config = g3_config::Config::load(config.config_path.as_deref())?;
|
let g3_config = g3_config::Config::load(config.config_path.as_deref())?;
|
||||||
let response = llm::call_refinement_llm_with_tools(
|
let response = llm::call_refinement_llm_with_tools(
|
||||||
|
|||||||
Reference in New Issue
Block a user