ralph-claude-code icon indicating copy to clipboard operation
ralph-claude-code copied to clipboard

is_error: false, triggers "error" circuit breaker incorrectly

Open txtr99 opened this issue 4 months ago • 0 comments

The Problem Chain

  1. In ralph_loop.sh (lines 413-416): bashif grep -q "error|Error|ERROR" "$output_file"; then has_errors="true" log_status "WARN" "Errors detected in output, check: $output_file" fi This triggers on ANY occurrence of "error" - including "is_error":false in JSON.
  2. Then record_loop_result is called (line 421): bashrecord_loop_result "$loop_count" "$files_changed" "$has_errors" "$output_length"
  3. In circuit_breaker.sh (lines 99-103): bashif [[ "$has_errors" == "true" ]]; then consecutive_same_error=$((consecutive_same_error + 1)) else consecutive_same_error=0 fi Every loop is counted as having "the same error" because the false positive triggers every time.
  4. Circuit breaker opens (lines 112-115): bashelif [[ $consecutive_same_error -ge $CB_SAME_ERROR_THRESHOLD ]]; then new_state="$CB_STATE_OPEN" reason="Same error repeated in $consecutive_same_error consecutive loops" fi After 5 loops (CB_SAME_ERROR_THRESHOLD=5), the circuit breaker opens.

txtr99 avatar Nov 27 '25 18:11 txtr99