ralph-claude-code
ralph-claude-code copied to clipboard
is_error: false, triggers "error" circuit breaker incorrectly
The Problem Chain
- 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.
- Then record_loop_result is called (line 421): bashrecord_loop_result "$loop_count" "$files_changed" "$has_errors" "$output_length"
- 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.
- 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.