Compare commits
6 Commits
jochen_fas
...
jochen_wri
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f6592efc2 | ||
|
|
99125fc39e | ||
|
|
c58aa80932 | ||
|
|
c6c35bf2ca | ||
|
|
c9fde4ecef | ||
|
|
467e300ec2 |
@@ -1703,16 +1703,6 @@ async fn run_autonomous(
|
|||||||
let loop_start = Instant::now();
|
let loop_start = Instant::now();
|
||||||
output.print("🔄 Starting coach-player feedback loop...");
|
output.print("🔄 Starting coach-player feedback loop...");
|
||||||
|
|
||||||
// Check if implementation files already exist
|
|
||||||
let skip_first_player = project.has_implementation_files();
|
|
||||||
if skip_first_player {
|
|
||||||
output.print("📂 Detected existing implementation files in workspace");
|
|
||||||
output.print("⏭️ Skipping first player turn - proceeding directly to coach review");
|
|
||||||
} else {
|
|
||||||
output.print("📂 No existing implementation files detected");
|
|
||||||
output.print("🎯 Starting with player implementation");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load fast-discovery messages before the loop starts (if enabled)
|
// Load fast-discovery messages before the loop starts (if enabled)
|
||||||
let (discovery_messages, discovery_working_dir): (Vec<g3_providers::Message>, Option<String>) =
|
let (discovery_messages, discovery_working_dir): (Vec<g3_providers::Message>, Option<String>) =
|
||||||
if let Some(ref codebase_path) = codebase_fast_start {
|
if let Some(ref codebase_path) = codebase_fast_start {
|
||||||
@@ -1753,8 +1743,7 @@ async fn run_autonomous(
|
|||||||
loop {
|
loop {
|
||||||
let turn_start_time = Instant::now();
|
let turn_start_time = Instant::now();
|
||||||
let turn_start_tokens = agent.get_context_window().used_tokens;
|
let turn_start_tokens = agent.get_context_window().used_tokens;
|
||||||
// Skip player turn if it's the first turn and implementation files exist
|
|
||||||
if !(turn == 1 && skip_first_player) {
|
|
||||||
output.print(&format!(
|
output.print(&format!(
|
||||||
"\n=== TURN {}/{} - PLAYER MODE ===",
|
"\n=== TURN {}/{} - PLAYER MODE ===",
|
||||||
turn, max_turns
|
turn, max_turns
|
||||||
@@ -1948,7 +1937,6 @@ async fn run_autonomous(
|
|||||||
|
|
||||||
// Give some time for file operations to complete
|
// Give some time for file operations to complete
|
||||||
tokio::time::sleep(tokio::time::Duration::from_millis(500)).await;
|
tokio::time::sleep(tokio::time::Duration::from_millis(500)).await;
|
||||||
}
|
|
||||||
|
|
||||||
// Create a new agent instance for coach mode to ensure fresh context
|
// Create a new agent instance for coach mode to ensure fresh context
|
||||||
// Use the same config with overrides that was passed to the player agent
|
// Use the same config with overrides that was passed to the player agent
|
||||||
|
|||||||
@@ -98,49 +98,6 @@ impl Project {
|
|||||||
self.requirements_text.is_some() || self.requirements_path.is_some()
|
self.requirements_text.is_some() || self.requirements_path.is_some()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Check if implementation files exist in the workspace
|
|
||||||
pub fn has_implementation_files(&self) -> bool {
|
|
||||||
self.check_dir_for_implementation_files(&self.workspace_dir)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Recursively check a directory for implementation files
|
|
||||||
#[allow(clippy::only_used_in_recursion)]
|
|
||||||
fn check_dir_for_implementation_files(&self, dir: &Path) -> bool {
|
|
||||||
// Common source file extensions
|
|
||||||
let extensions = vec![
|
|
||||||
"swift", "rs", "py", "js", "ts", "java", "cpp", "c",
|
|
||||||
"go", "rb", "php", "cs", "kt", "scala", "m", "h"
|
|
||||||
];
|
|
||||||
|
|
||||||
if let Ok(entries) = std::fs::read_dir(dir) {
|
|
||||||
for entry in entries.flatten() {
|
|
||||||
let path = entry.path();
|
|
||||||
|
|
||||||
if path.is_file() {
|
|
||||||
// Check if it's a source file
|
|
||||||
if let Some(ext) = path.extension() {
|
|
||||||
if let Some(ext_str) = ext.to_str() {
|
|
||||||
if extensions.contains(&ext_str) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if path.is_dir() {
|
|
||||||
// Skip hidden directories and common non-source directories
|
|
||||||
if let Some(name) = path.file_name().and_then(|n| n.to_str()) {
|
|
||||||
if !name.starts_with('.') && name != "logs" && name != "target" && name != "node_modules" {
|
|
||||||
// Recursively check subdirectories
|
|
||||||
if self.check_dir_for_implementation_files(&path) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Read the requirements file content
|
/// Read the requirements file content
|
||||||
pub fn read_requirements(&self) -> Result<Option<String>> {
|
pub fn read_requirements(&self) -> Result<Option<String>> {
|
||||||
// Prioritize requirements text override
|
// Prioritize requirements text override
|
||||||
|
|||||||
Reference in New Issue
Block a user