Claude Code Claude Opus 4.6 commited on
Commit
8f735cf
Β·
1 Parent(s): 46cea78

god: Faster CC timeout + forbid discussion when CC busy with zero pushes

Browse files

- Lower zero-push CC timeout from 90s to 30s β€” escalate critical warnings faster
- Strengthen messages to explicitly forbid discussion during CC busy state
- Change "discuss and plan" to "PLAN concrete work only"
- Stale CC message now demands specific planning, not discussion

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. scripts/conversation-loop.py +10 -8
scripts/conversation-loop.py CHANGED
@@ -1896,21 +1896,23 @@ def build_turn_message(speaker, other, ctx):
1896
 
1897
  # Now state-specific guidance
1898
  if cc_busy and _cc_stale_count >= 2:
1899
- parts.append(f"\nClaude Code is WORKING but no new output. Discuss plans with {other} instead.")
 
1900
  elif cc_busy:
1901
  # CRITICAL: Check if push frequency is dangerously low (0 or very few pushes)
1902
  cc_elapsed = int(time.time() - cc_status.get("started", 0)) if cc_status.get("started", 0) > 0 else 0
1903
  if _push_count_this_task == 0 and _turns_since_last_push >= 1:
1904
- # CRITICAL TIMEOUT: Lower threshold (90s) when zero pushes THIS TASK - CC might be stuck
1905
- if cc_elapsed > 90:
 
1906
  parts.append(f"\n🚨 CRITICAL: Claude Code has been running for {cc_elapsed}s with ZERO pushes THIS TASK!")
1907
  parts.append(f"CC might be STUCK. If output looks stale, use [ACTION: terminate_cc] NOW to kill it and re-assign.")
1908
  parts.append(f"Do NOT keep waiting. Trial-and-error requires PUSHING code, not watching stuck processes.")
 
1909
  else:
1910
  parts.append(f"\n🚨 CRITICAL: Claude Code is WORKING, but ZERO pushes THIS TASK so far!")
1911
- parts.append(f"STOP 'standing by' and 'monitoring'. PLAN your next [TASK] NOW.")
1912
- parts.append(f"Write down exactly what [TASK] you will assign when CC finishes.")
1913
- parts.append(f"Trial-and-error requires PUSHING code, not waiting.")
1914
  elif (_push_count_this_task <= 1 and _turns_since_last_push >= 5) or (_push_count_this_task > 1 and _turns_since_last_push >= 10):
1915
  # LOW PUSH FREQUENCY WARNING: Catches the "1 push then 62 turns of discussion" anti-pattern
1916
  if cc_elapsed > 60:
@@ -1926,8 +1928,8 @@ def build_turn_message(speaker, other, ctx):
1926
  parts.append(f"\n🚨 URGENT: Claude Code is WORKING, but it's been {_turns_since_last_push} turns since last push.")
1927
  parts.append(f"DO NOT just discuss. PLAN your next [TASK] NOW so you can push immediately when CC finishes.")
1928
  else:
1929
- parts.append(f"\nClaude Code is WORKING. PLAN your next move with {other} β€” what [TASK] will you assign next?")
1930
- parts.append(f"DO NOT just say 'standing by' or 'monitoring'. Be productive β€” plan concrete work.")
1931
  elif child_state["stage"] in ("BUILDING", "RESTARTING", "APP_STARTING", "RUNNING_APP_STARTING"):
1932
  # Check cooldown and inform agents
1933
  check_and_clear_cooldown()
 
1896
 
1897
  # Now state-specific guidance
1898
  if cc_busy and _cc_stale_count >= 2:
1899
+ parts.append(f"\nClaude Code is WORKING but no new output. PLAN your next [TASK] concretely β€” what exact changes will you assign?")
1900
+ parts.append(f"DO NOT discuss. Write specific file paths and function names for your next task.")
1901
  elif cc_busy:
1902
  # CRITICAL: Check if push frequency is dangerously low (0 or very few pushes)
1903
  cc_elapsed = int(time.time() - cc_status.get("started", 0)) if cc_status.get("started", 0) > 0 else 0
1904
  if _push_count_this_task == 0 and _turns_since_last_push >= 1:
1905
+ # CRITICAL TIMEOUT: Lower threshold (30s) when zero pushes THIS TASK - CC might be stuck
1906
+ # Faster escalation prevents discussion loops
1907
+ if cc_elapsed > 30:
1908
  parts.append(f"\n🚨 CRITICAL: Claude Code has been running for {cc_elapsed}s with ZERO pushes THIS TASK!")
1909
  parts.append(f"CC might be STUCK. If output looks stale, use [ACTION: terminate_cc] NOW to kill it and re-assign.")
1910
  parts.append(f"Do NOT keep waiting. Trial-and-error requires PUSHING code, not watching stuck processes.")
1911
+ parts.append(f"πŸ›‘ DO NOT DISCUSS. This is your ONLY warning - PLAN concrete work NOW.")
1912
  else:
1913
  parts.append(f"\n🚨 CRITICAL: Claude Code is WORKING, but ZERO pushes THIS TASK so far!")
1914
+ parts.append(f"πŸ›‘ DO NOT DISCUSS. Write down exactly what [TASK] you will assign when CC finishes.")
1915
+ parts.append(f"Be SPECIFIC: file paths, function names, exact changes. Trial-and-error requires PUSHING code.")
 
1916
  elif (_push_count_this_task <= 1 and _turns_since_last_push >= 5) or (_push_count_this_task > 1 and _turns_since_last_push >= 10):
1917
  # LOW PUSH FREQUENCY WARNING: Catches the "1 push then 62 turns of discussion" anti-pattern
1918
  if cc_elapsed > 60:
 
1928
  parts.append(f"\n🚨 URGENT: Claude Code is WORKING, but it's been {_turns_since_last_push} turns since last push.")
1929
  parts.append(f"DO NOT just discuss. PLAN your next [TASK] NOW so you can push immediately when CC finishes.")
1930
  else:
1931
+ parts.append(f"\nClaude Code is WORKING. PLAN your next [TASK] β€” write down specific changes: file paths, function names.")
1932
+ parts.append(f"DO NOT discuss architecture or theory. PLAN concrete work only β€” what exact [TASK] will you assign when CC finishes?")
1933
  elif child_state["stage"] in ("BUILDING", "RESTARTING", "APP_STARTING", "RUNNING_APP_STARTING"):
1934
  # Check cooldown and inform agents
1935
  check_and_clear_cooldown()