tao-shen Claude Opus 4.6 commited on
Commit
ea70f5d
·
1 Parent(s): e91c753

fix: change break→continue in action guards to preserve multi-action turns

Browse files

When a single action was blocked by safety guards (rebuild cooldown,
ACT-phase guard, knowledge dedup), the `break` statement terminated
the entire action-parsing loop, discarding all remaining actions in
the LLM's multi-action output. Changed to `continue` so blocked
actions are skipped while the rest still execute.

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

Files changed (1) hide show
  1. scripts/conversation-loop.py +3 -3
scripts/conversation-loop.py CHANGED
@@ -614,7 +614,7 @@ def parse_and_execute_actions(raw_text, depth=0):
614
  "Use [ACTION: check_health] to monitor the current build.")
615
  results.append({"action": action_str, "result": result})
616
  print(f"[BLOCKED] {name} — rebuild cooldown ({remaining}s remaining)")
617
- break
618
 
619
  # Block read-only actions based on workflow state
620
  if workflow_state == "ACT" and name in ("read_file", "list_files", "check_health"):
@@ -623,7 +623,7 @@ def parse_and_execute_actions(raw_text, depth=0):
623
  "You already have enough information — make a change NOW.")
624
  results.append({"action": action_str, "result": result})
625
  print(f"[BLOCKED] {name} — forced ACT phase")
626
- break
627
 
628
  # Block re-reading files already in knowledge base
629
  if name == "read_file" and len(args) >= 2:
@@ -634,7 +634,7 @@ def parse_and_execute_actions(raw_text, depth=0):
634
  "If you need a different file, read a NEW one.")
635
  results.append({"action": action_str, "result": result})
636
  print(f"[BLOCKED] {name} — already read {file_key}")
637
- break
638
 
639
  result = None
640
  if name == "create_child":
 
614
  "Use [ACTION: check_health] to monitor the current build.")
615
  results.append({"action": action_str, "result": result})
616
  print(f"[BLOCKED] {name} — rebuild cooldown ({remaining}s remaining)")
617
+ continue # Don't kill remaining actions — reads/checks can still proceed
618
 
619
  # Block read-only actions based on workflow state
620
  if workflow_state == "ACT" and name in ("read_file", "list_files", "check_health"):
 
623
  "You already have enough information — make a change NOW.")
624
  results.append({"action": action_str, "result": result})
625
  print(f"[BLOCKED] {name} — forced ACT phase")
626
+ continue # Don't kill remaining actions — writes after a blocked read should still execute
627
 
628
  # Block re-reading files already in knowledge base
629
  if name == "read_file" and len(args) >= 2:
 
634
  "If you need a different file, read a NEW one.")
635
  results.append({"action": action_str, "result": result})
636
  print(f"[BLOCKED] {name} — already read {file_key}")
637
+ continue # Don't kill remaining actions — skip this read, execute the rest
638
 
639
  result = None
640
  if name == "create_child":