Spaces:
Runtime error
Runtime error
Claude Code commited on
Commit ·
d66055d
1
Parent(s): 83f9fff
god: Faster CC timeout + forbid discussion when CC busy with zero pushes
Browse files
scripts/conversation-loop.py
CHANGED
|
@@ -2698,14 +2698,16 @@ while True:
|
|
| 2698 |
# Prevents infinite discussion loops where agents wait forever for stuck CC
|
| 2699 |
if cc_status["running"]:
|
| 2700 |
task_elapsed = time.time() - cc_status["started"]
|
| 2701 |
-
# When child is in ERROR, use shorter timeout for faster iteration (45s vs 90s)
|
| 2702 |
child_in_error = child_state["stage"] in ("RUNTIME_ERROR", "BUILD_ERROR", "CONFIG_ERROR")
|
| 2703 |
# If agents are actively discussing (have context) while CC is stuck on analysis, terminate faster
|
| 2704 |
# Discussion means agents likely have the fix location - no need to wait for file reading
|
| 2705 |
if child_in_error and _discussion_loop_count >= 3:
|
| 2706 |
timeout = 20 # Very fast: agents know what's wrong, CC is just wasting time reading
|
|
|
|
|
|
|
| 2707 |
elif child_in_error:
|
| 2708 |
-
timeout =
|
| 2709 |
else:
|
| 2710 |
timeout = 90 # Normal timeout for healthy child
|
| 2711 |
# Auto-terminate if: (0 pushes and timeout elapsed) OR (<=1 push and 10+ turns since last push and 60s elapsed)
|
|
|
|
| 2698 |
# Prevents infinite discussion loops where agents wait forever for stuck CC
|
| 2699 |
if cc_status["running"]:
|
| 2700 |
task_elapsed = time.time() - cc_status["started"]
|
| 2701 |
+
# When child is in ERROR, use shorter timeout for faster iteration (20s-45s vs 60s-90s)
|
| 2702 |
child_in_error = child_state["stage"] in ("RUNTIME_ERROR", "BUILD_ERROR", "CONFIG_ERROR")
|
| 2703 |
# If agents are actively discussing (have context) while CC is stuck on analysis, terminate faster
|
| 2704 |
# Discussion means agents likely have the fix location - no need to wait for file reading
|
| 2705 |
if child_in_error and _discussion_loop_count >= 3:
|
| 2706 |
timeout = 20 # Very fast: agents know what's wrong, CC is just wasting time reading
|
| 2707 |
+
elif _push_count_this_task == 0 and task_elapsed > 30:
|
| 2708 |
+
timeout = 45 # Fail FAST when stuck at zero pushes with child in error
|
| 2709 |
elif child_in_error:
|
| 2710 |
+
timeout = 60 # Fast iteration when child is broken
|
| 2711 |
else:
|
| 2712 |
timeout = 90 # Normal timeout for healthy child
|
| 2713 |
# Auto-terminate if: (0 pushes and timeout elapsed) OR (<=1 push and 10+ turns since last push and 60s elapsed)
|