fix: reset circuit breaker failures after recovery#100
Conversation
Greptile SummaryThis PR fixes a circuit breaker bug (#97) where Confidence Score: 5/5Safe to merge — the fix is minimal, logically sound, and covered by a deterministic regression test. The change correctly addresses the described bug with no new issues introduced. The only nuance worth knowing (not a blocker) is that the reset is lazy: it fires the first time No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["is_circuit_open(now)"] --> B{consecutive_failures < THRESHOLD?}
B -- yes --> C[return false - circuit closed]
B -- no --> D{duration_since last_failure < RECOVERY_TIME?}
D -- yes --> E[return true - circuit open]
D -- no --> F[consecutive_failures = 0 - reset stale count]
F --> G[return false - circuit recovered]
Reviews (1): Last reviewed commit: "fix: reset circuit breaker failures afte..." | Re-trigger Greptile |
Summary
Testing
Closes #97