mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-02-02 07:23:35 +00:00
Merge pull request #50 from kunalnano/fix/agent-completion-exit
fix: exit agent loop when all features pass
This commit is contained in:
10
agent.py
10
agent.py
@@ -14,7 +14,7 @@ from pathlib import Path
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
from zoneinfo import ZoneInfo
|
from zoneinfo import ZoneInfo
|
||||||
|
|
||||||
from claude_agent_sdk import ClaudeSDKClient
|
from claude_code_sdk import ClaudeSDKClient
|
||||||
|
|
||||||
# Fix Windows console encoding for Unicode characters (emoji, etc.)
|
# Fix Windows console encoding for Unicode characters (emoji, etc.)
|
||||||
# Without this, print() crashes when Claude outputs emoji like ✅
|
# Without this, print() crashes when Claude outputs emoji like ✅
|
||||||
@@ -238,6 +238,14 @@ async def run_autonomous_agent(
|
|||||||
# Don't crash - return error status so the loop can retry
|
# Don't crash - return error status so the loop can retry
|
||||||
status, response = "error", str(e)
|
status, response = "error", str(e)
|
||||||
|
|
||||||
|
# Check for project completion - EXIT when all features pass
|
||||||
|
if "all features are passing" in response.lower() or "no more work to do" in response.lower():
|
||||||
|
print("\n" + "=" * 70)
|
||||||
|
print(" 🎉 PROJECT COMPLETE - ALL FEATURES PASSING!")
|
||||||
|
print("=" * 70)
|
||||||
|
print_progress_summary(project_dir)
|
||||||
|
break
|
||||||
|
|
||||||
# Handle status
|
# Handle status
|
||||||
if status == "continue":
|
if status == "continue":
|
||||||
delay_seconds = AUTO_CONTINUE_DELAY_SECONDS
|
delay_seconds = AUTO_CONTINUE_DELAY_SECONDS
|
||||||
|
|||||||
Reference in New Issue
Block a user