auto mode report
This commit is contained in:
@@ -885,15 +885,27 @@ async fn run_autonomous(
|
|||||||
output.print("📊 AUTONOMOUS MODE SESSION REPORT");
|
output.print("📊 AUTONOMOUS MODE SESSION REPORT");
|
||||||
output.print(&"=".repeat(60));
|
output.print(&"=".repeat(60));
|
||||||
|
|
||||||
output.print(&format!("⏱️ Total Duration: {:.2}s", elapsed.as_secs_f64()));
|
output.print(&format!(
|
||||||
|
"⏱️ Total Duration: {:.2}s",
|
||||||
|
elapsed.as_secs_f64()
|
||||||
|
));
|
||||||
output.print(&format!("🔄 Turns Taken: 0/{}", max_turns));
|
output.print(&format!("🔄 Turns Taken: 0/{}", max_turns));
|
||||||
output.print(&format!("📝 Final Status: ⚠️ NO REQUIREMENTS FILE"));
|
output.print(&format!("📝 Final Status: ⚠️ NO REQUIREMENTS FILE"));
|
||||||
|
|
||||||
output.print("\n📈 Token Usage Statistics:");
|
output.print("\n📈 Token Usage Statistics:");
|
||||||
output.print(&format!(" • Used Tokens: {}", context_window.used_tokens));
|
output.print(&format!(" • Used Tokens: {}", context_window.used_tokens));
|
||||||
output.print(&format!(" • Total Available: {}", context_window.total_tokens));
|
output.print(&format!(
|
||||||
output.print(&format!(" • Cumulative Tokens: {}", context_window.cumulative_tokens));
|
" • Total Available: {}",
|
||||||
output.print(&format!(" • Usage Percentage: {:.1}%", context_window.percentage_used()));
|
context_window.total_tokens
|
||||||
|
));
|
||||||
|
output.print(&format!(
|
||||||
|
" • Cumulative Tokens: {}",
|
||||||
|
context_window.cumulative_tokens
|
||||||
|
));
|
||||||
|
output.print(&format!(
|
||||||
|
" • Usage Percentage: {:.1}%",
|
||||||
|
context_window.percentage_used()
|
||||||
|
));
|
||||||
output.print(&"=".repeat(60));
|
output.print(&"=".repeat(60));
|
||||||
|
|
||||||
return Ok(());
|
return Ok(());
|
||||||
@@ -913,15 +925,27 @@ async fn run_autonomous(
|
|||||||
output.print("📊 AUTONOMOUS MODE SESSION REPORT");
|
output.print("📊 AUTONOMOUS MODE SESSION REPORT");
|
||||||
output.print(&"=".repeat(60));
|
output.print(&"=".repeat(60));
|
||||||
|
|
||||||
output.print(&format!("⏱️ Total Duration: {:.2}s", elapsed.as_secs_f64()));
|
output.print(&format!(
|
||||||
|
"⏱️ Total Duration: {:.2}s",
|
||||||
|
elapsed.as_secs_f64()
|
||||||
|
));
|
||||||
output.print(&format!("🔄 Turns Taken: 0/{}", max_turns));
|
output.print(&format!("🔄 Turns Taken: 0/{}", max_turns));
|
||||||
output.print(&format!("📝 Final Status: ⚠️ CANNOT READ REQUIREMENTS"));
|
output.print(&format!("📝 Final Status: ⚠️ CANNOT READ REQUIREMENTS"));
|
||||||
|
|
||||||
output.print("\n📈 Token Usage Statistics:");
|
output.print("\n📈 Token Usage Statistics:");
|
||||||
output.print(&format!(" • Used Tokens: {}", context_window.used_tokens));
|
output.print(&format!(" • Used Tokens: {}", context_window.used_tokens));
|
||||||
output.print(&format!(" • Total Available: {}", context_window.total_tokens));
|
output.print(&format!(
|
||||||
output.print(&format!(" • Cumulative Tokens: {}", context_window.cumulative_tokens));
|
" • Total Available: {}",
|
||||||
output.print(&format!(" • Usage Percentage: {:.1}%", context_window.percentage_used()));
|
context_window.total_tokens
|
||||||
|
));
|
||||||
|
output.print(&format!(
|
||||||
|
" • Cumulative Tokens: {}",
|
||||||
|
context_window.cumulative_tokens
|
||||||
|
));
|
||||||
|
output.print(&format!(
|
||||||
|
" • Usage Percentage: {:.1}%",
|
||||||
|
context_window.percentage_used()
|
||||||
|
));
|
||||||
output.print(&"=".repeat(60));
|
output.print(&"=".repeat(60));
|
||||||
|
|
||||||
return Ok(());
|
return Ok(());
|
||||||
@@ -975,7 +999,14 @@ async fn run_autonomous(
|
|||||||
|
|
||||||
loop {
|
loop {
|
||||||
match agent
|
match agent
|
||||||
.execute_task_with_timing(&player_prompt, None, false, show_prompt, show_code, true)
|
.execute_task_with_timing(
|
||||||
|
&player_prompt,
|
||||||
|
None,
|
||||||
|
false,
|
||||||
|
show_prompt,
|
||||||
|
show_code,
|
||||||
|
true,
|
||||||
|
)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
Ok(result) => {
|
Ok(result) => {
|
||||||
@@ -997,25 +1028,45 @@ async fn run_autonomous(
|
|||||||
output.print("📊 AUTONOMOUS MODE SESSION REPORT");
|
output.print("📊 AUTONOMOUS MODE SESSION REPORT");
|
||||||
output.print(&"=".repeat(60));
|
output.print(&"=".repeat(60));
|
||||||
|
|
||||||
output.print(&format!("⏱️ Total Duration: {:.2}s", elapsed.as_secs_f64()));
|
output.print(&format!(
|
||||||
|
"⏱️ Total Duration: {:.2}s",
|
||||||
|
elapsed.as_secs_f64()
|
||||||
|
));
|
||||||
output.print(&format!("🔄 Turns Taken: {}/{}", turn, max_turns));
|
output.print(&format!("🔄 Turns Taken: {}/{}", turn, max_turns));
|
||||||
output.print(&format!("📝 Final Status: 💥 PLAYER PANIC"));
|
output.print(&format!("📝 Final Status: 💥 PLAYER PANIC"));
|
||||||
|
|
||||||
output.print("\n📈 Token Usage Statistics:");
|
output.print("\n📈 Token Usage Statistics:");
|
||||||
output.print(&format!(" • Used Tokens: {}", context_window.used_tokens));
|
output.print(&format!(
|
||||||
output.print(&format!(" • Total Available: {}", context_window.total_tokens));
|
" • Used Tokens: {}",
|
||||||
output.print(&format!(" • Cumulative Tokens: {}", context_window.cumulative_tokens));
|
context_window.used_tokens
|
||||||
output.print(&format!(" • Usage Percentage: {:.1}%", context_window.percentage_used()));
|
));
|
||||||
|
output.print(&format!(
|
||||||
|
" • Total Available: {}",
|
||||||
|
context_window.total_tokens
|
||||||
|
));
|
||||||
|
output.print(&format!(
|
||||||
|
" • Cumulative Tokens: {}",
|
||||||
|
context_window.cumulative_tokens
|
||||||
|
));
|
||||||
|
output.print(&format!(
|
||||||
|
" • Usage Percentage: {:.1}%",
|
||||||
|
context_window.percentage_used()
|
||||||
|
));
|
||||||
output.print(&"=".repeat(60));
|
output.print(&"=".repeat(60));
|
||||||
|
|
||||||
return Err(e);
|
return Err(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
player_retry_count += 1;
|
player_retry_count += 1;
|
||||||
output.print(&format!("⚠️ Player error (attempt {}/{}): {}", player_retry_count, MAX_PLAYER_RETRIES, e));
|
output.print(&format!(
|
||||||
|
"⚠️ Player error (attempt {}/{}): {}",
|
||||||
|
player_retry_count, MAX_PLAYER_RETRIES, e
|
||||||
|
));
|
||||||
|
|
||||||
if player_retry_count >= MAX_PLAYER_RETRIES {
|
if player_retry_count >= MAX_PLAYER_RETRIES {
|
||||||
output.print("🔄 Max retries reached for player, marking turn as failed...");
|
output.print(
|
||||||
|
"🔄 Max retries reached for player, marking turn as failed...",
|
||||||
|
);
|
||||||
player_failed = true;
|
player_failed = true;
|
||||||
break; // Exit retry loop
|
break; // Exit retry loop
|
||||||
}
|
}
|
||||||
@@ -1026,7 +1077,10 @@ async fn run_autonomous(
|
|||||||
|
|
||||||
// If player failed after max retries, increment turn and continue
|
// If player failed after max retries, increment turn and continue
|
||||||
if player_failed {
|
if player_failed {
|
||||||
output.print(&format!("⚠️ Player turn {} failed after max retries. Moving to next turn.", turn));
|
output.print(&format!(
|
||||||
|
"⚠️ Player turn {} failed after max retries. Moving to next turn.",
|
||||||
|
turn
|
||||||
|
));
|
||||||
turn += 1;
|
turn += 1;
|
||||||
|
|
||||||
// Check if we've reached max turns
|
// Check if we've reached max turns
|
||||||
@@ -1118,22 +1172,37 @@ Remember: Be thorough in your review but concise in your feedback. APPROVE if th
|
|||||||
output.print("📊 AUTONOMOUS MODE SESSION REPORT");
|
output.print("📊 AUTONOMOUS MODE SESSION REPORT");
|
||||||
output.print(&"=".repeat(60));
|
output.print(&"=".repeat(60));
|
||||||
|
|
||||||
output.print(&format!("⏱️ Total Duration: {:.2}s", elapsed.as_secs_f64()));
|
output.print(&format!(
|
||||||
|
"⏱️ Total Duration: {:.2}s",
|
||||||
|
elapsed.as_secs_f64()
|
||||||
|
));
|
||||||
output.print(&format!("🔄 Turns Taken: {}/{}", turn, max_turns));
|
output.print(&format!("🔄 Turns Taken: {}/{}", turn, max_turns));
|
||||||
output.print(&format!("📝 Final Status: 💥 COACH PANIC"));
|
output.print(&format!("📝 Final Status: 💥 COACH PANIC"));
|
||||||
|
|
||||||
output.print("\n📈 Token Usage Statistics:");
|
output.print("\n📈 Token Usage Statistics:");
|
||||||
output.print(&format!(" • Used Tokens: {}", context_window.used_tokens));
|
output.print(&format!(" • Used Tokens: {}", context_window.used_tokens));
|
||||||
output.print(&format!(" • Total Available: {}", context_window.total_tokens));
|
output.print(&format!(
|
||||||
output.print(&format!(" • Cumulative Tokens: {}", context_window.cumulative_tokens));
|
" • Total Available: {}",
|
||||||
output.print(&format!(" • Usage Percentage: {:.1}%", context_window.percentage_used()));
|
context_window.total_tokens
|
||||||
|
));
|
||||||
|
output.print(&format!(
|
||||||
|
" • Cumulative Tokens: {}",
|
||||||
|
context_window.cumulative_tokens
|
||||||
|
));
|
||||||
|
output.print(&format!(
|
||||||
|
" • Usage Percentage: {:.1}%",
|
||||||
|
context_window.percentage_used()
|
||||||
|
));
|
||||||
output.print(&"=".repeat(60));
|
output.print(&"=".repeat(60));
|
||||||
|
|
||||||
return Err(e);
|
return Err(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
coach_retry_count += 1;
|
coach_retry_count += 1;
|
||||||
output.print(&format!("⚠️ Coach error (attempt {}/{}): {}", coach_retry_count, MAX_COACH_RETRIES, e));
|
output.print(&format!(
|
||||||
|
"⚠️ Coach error (attempt {}/{}): {}",
|
||||||
|
coach_retry_count, MAX_COACH_RETRIES, e
|
||||||
|
));
|
||||||
|
|
||||||
if coach_retry_count >= MAX_COACH_RETRIES {
|
if coach_retry_count >= MAX_COACH_RETRIES {
|
||||||
output.print("🔄 Max retries reached for coach, using default feedback...");
|
output.print("🔄 Max retries reached for coach, using default feedback...");
|
||||||
@@ -1151,7 +1220,10 @@ Remember: Be thorough in your review but concise in your feedback. APPROVE if th
|
|||||||
|
|
||||||
// If coach failed after max retries, increment turn and continue with default feedback
|
// If coach failed after max retries, increment turn and continue with default feedback
|
||||||
if coach_failed {
|
if coach_failed {
|
||||||
output.print(&format!("⚠️ Coach turn {} failed after max retries. Using default feedback.", turn));
|
output.print(&format!(
|
||||||
|
"⚠️ Coach turn {} failed after max retries. Using default feedback.",
|
||||||
|
turn
|
||||||
|
));
|
||||||
coach_feedback = "The implementation needs review. Please ensure all requirements are met and the code compiles without errors.".to_string();
|
coach_feedback = "The implementation needs review. Please ensure all requirements are met and the code compiles without errors.".to_string();
|
||||||
turn += 1;
|
turn += 1;
|
||||||
|
|
||||||
@@ -1216,9 +1288,13 @@ Remember: Be thorough in your review but concise in your feedback. APPROVE if th
|
|||||||
output.print("📊 AUTONOMOUS MODE SESSION REPORT");
|
output.print("📊 AUTONOMOUS MODE SESSION REPORT");
|
||||||
output.print(&"=".repeat(60));
|
output.print(&"=".repeat(60));
|
||||||
|
|
||||||
output.print(&format!("⏱️ Total Duration: {:.2}s", elapsed.as_secs_f64()));
|
output.print(&format!(
|
||||||
|
"⏱️ Total Duration: {:.2}s",
|
||||||
|
elapsed.as_secs_f64()
|
||||||
|
));
|
||||||
output.print(&format!("🔄 Turns Taken: {}/{}", turn, max_turns));
|
output.print(&format!("🔄 Turns Taken: {}/{}", turn, max_turns));
|
||||||
output.print(&format!("📝 Final Status: {}",
|
output.print(&format!(
|
||||||
|
"📝 Final Status: {}",
|
||||||
if implementation_approved {
|
if implementation_approved {
|
||||||
"✅ APPROVED"
|
"✅ APPROVED"
|
||||||
} else if turn >= max_turns {
|
} else if turn >= max_turns {
|
||||||
@@ -1230,15 +1306,24 @@ Remember: Be thorough in your review but concise in your feedback. APPROVE if th
|
|||||||
|
|
||||||
output.print("\n📈 Token Usage Statistics:");
|
output.print("\n📈 Token Usage Statistics:");
|
||||||
output.print(&format!(" • Used Tokens: {}", context_window.used_tokens));
|
output.print(&format!(" • Used Tokens: {}", context_window.used_tokens));
|
||||||
output.print(&format!(" • Total Available: {}", context_window.total_tokens));
|
output.print(&format!(
|
||||||
output.print(&format!(" • Cumulative Tokens: {}", context_window.cumulative_tokens));
|
" • Total Available: {}",
|
||||||
output.print(&format!(" • Usage Percentage: {:.1}%", context_window.percentage_used()));
|
context_window.total_tokens
|
||||||
|
));
|
||||||
|
output.print(&format!(
|
||||||
|
" • Cumulative Tokens: {}",
|
||||||
|
context_window.cumulative_tokens
|
||||||
|
));
|
||||||
|
output.print(&format!(
|
||||||
|
" • Usage Percentage: {:.1}%",
|
||||||
|
context_window.percentage_used()
|
||||||
|
));
|
||||||
output.print(&"=".repeat(60));
|
output.print(&"=".repeat(60));
|
||||||
|
|
||||||
if implementation_approved {
|
if implementation_approved {
|
||||||
output.print("\n🎉 Autonomous mode completed successfully");
|
output.print("\n🎉 Autonomous mode completed successfully");
|
||||||
} else {
|
} else {
|
||||||
output.print("\n🔄 Autonomous mode completed (max iterations)");
|
output.print("\n🔄 Autonomous mode terminated (max iterations)");
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
Reference in New Issue
Block a user