fix: Recognize STATUS: COMPLETE as progress in circuit breaker#140
Conversation
The circuit breaker was only detecting progress through git diff changes. When Claude completed work and committed it, subsequent loops showed 0 uncommitted changes, causing the circuit breaker to trip after 3 loops. This fix adds multiple progress detection sources: 1. Git diff changes (existing) 2. has_completion_signal from response analysis (STATUS: COMPLETE) 3. files_modified reported by Claude in RALPH_STATUS block This ensures that completed work is recognized as progress even when all changes have been committed to git. Fixes issue where circuit breaker would repeatedly trip on projects where Claude finishes tasks and commits them immediately.
WalkthroughExpands progress detection in Changes
Sequence Diagram(s)(Skipped — changes are contained within a single script and modify internal progress-detection logic without introducing a broader multi-component protocol that requires visualization.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Recognize completion signals in
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@lib/circuit_breaker.sh`:
- Around line 108-131: The combined declaration+assignment for exit_signal masks
jq failures; instead declare exit_signal first (e.g., local exit_signal), then
assign it from jq with a separate command substitution and fallback
(exit_signal=$(jq -r '.analysis.exit_signal // false' "$response_analysis_file"
2>/dev/null || echo "false")), and preserve the subsequent conditional that sets
has_completion_signal when exit_signal == "true"; update the same pattern if
there are any other local+assignment uses (see exit_signal,
response_analysis_file, has_completion_signal).
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
@claude Review the PR |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Summary
Problem
The circuit breaker was only detecting progress through
git diffchanges. When Claude completed work and committed it, subsequent loops showed 0 uncommitted changes, causing the circuit breaker to trip after 3 loops with "No progress detected."This was happening in projects like mcli where Claude would:
STATUS: COMPLETEwithFILES_MODIFIED: 6git diffshows 0 changesSolution
Add multiple progress detection sources in
record_loop_result():.response_analysis- Claude'sSTATUS: COMPLETEIf any of these indicate progress, reset the consecutive_no_progress counter.
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.