Spaces:
Runtime error
Runtime error
Claude Code commited on
Commit ·
67854aa
1
Parent(s): 861c45e
god: Force task assignment at 2 discussion turns (was 3)
Browse files
scripts/conversation-loop.py
CHANGED
|
@@ -2226,7 +2226,7 @@ def do_turn(speaker, other, space_url):
|
|
| 2226 |
print(f"[CC-AUTO-KILL] {terminate_result}")
|
| 2227 |
|
| 2228 |
# EMERGENCY OVERRIDE: Force a task assignment if agents are stuck in discussion loop OR push frequency crisis
|
| 2229 |
-
# This bypasses the agent when they've discussed for
|
| 2230 |
# IMPORTANT: Also triggers when child is in ERROR state (not alive) - that's when agents are most stuck!
|
| 2231 |
# CRITICAL: Also triggers on PUSH FREQUENCY CRISIS - _discussion_loop_count resets on forced tasks, so we need this backup
|
| 2232 |
cc_busy = cc_status["running"]
|
|
@@ -2234,7 +2234,8 @@ def do_turn(speaker, other, space_url):
|
|
| 2234 |
child_in_error = child_state["stage"] in ("RUNTIME_ERROR", "BUILD_ERROR", "CONFIG_ERROR")
|
| 2235 |
# Push frequency crisis: trigger when 10+ turns without push (even with CC busy) or 8+ turns with CC idle
|
| 2236 |
push_freq_crisis = (_turns_since_last_push >= 10) or (_turns_since_last_push >= 8 and not cc_busy)
|
| 2237 |
-
|
|
|
|
| 2238 |
# EMERGENCY OVERRIDE: Force a task assignment if agents are stuck in discussion loop
|
| 2239 |
if push_freq_crisis:
|
| 2240 |
print(f"[LOOP-BREAK] EMERGENCY: {speaker} has {_turns_since_last_push} turns since last push (PUSH FREQUENCY CRISIS). Forcing task assignment.")
|
|
|
|
| 2226 |
print(f"[CC-AUTO-KILL] {terminate_result}")
|
| 2227 |
|
| 2228 |
# EMERGENCY OVERRIDE: Force a task assignment if agents are stuck in discussion loop OR push frequency crisis
|
| 2229 |
+
# This bypasses the agent when they've discussed for 2+ turns with CC idle (lowered from 3 for faster action)
|
| 2230 |
# IMPORTANT: Also triggers when child is in ERROR state (not alive) - that's when agents are most stuck!
|
| 2231 |
# CRITICAL: Also triggers on PUSH FREQUENCY CRISIS - _discussion_loop_count resets on forced tasks, so we need this backup
|
| 2232 |
cc_busy = cc_status["running"]
|
|
|
|
| 2234 |
child_in_error = child_state["stage"] in ("RUNTIME_ERROR", "BUILD_ERROR", "CONFIG_ERROR")
|
| 2235 |
# Push frequency crisis: trigger when 10+ turns without push (even with CC busy) or 8+ turns with CC idle
|
| 2236 |
push_freq_crisis = (_turns_since_last_push >= 10) or (_turns_since_last_push >= 8 and not cc_busy)
|
| 2237 |
+
# Lowered threshold from 3 to 2: fail fast, force action earlier when CC is idle
|
| 2238 |
+
if (_discussion_loop_count >= 2 and not cc_busy and (child_alive or child_in_error)) or push_freq_crisis:
|
| 2239 |
# EMERGENCY OVERRIDE: Force a task assignment if agents are stuck in discussion loop
|
| 2240 |
if push_freq_crisis:
|
| 2241 |
print(f"[LOOP-BREAK] EMERGENCY: {speaker} has {_turns_since_last_push} turns since last push (PUSH FREQUENCY CRISIS). Forcing task assignment.")
|