One function
LoopDetector in AgentBudget/agentbudget
The author described this change as “fix: correct off-by-one in loop detection threshold”. It counts as a record because the check below fails on the code as it stood at 6c29cd949 and passes on 144a2b83e, with nothing else changed between the two runs.
ProjectAgentBudget/agentbudget
Fix saved2026-03-25
Sharing licenceApache-2.0 · LICENSE
Change size+1 −1
What the code was meant to do, written into the code itself as a docstring
Detects when the same tool/model is called repeatedly in a short window.
The change
| 16 | 16 | ] | |
| 17 | 17 | self._call_log[key].append(now) | |
| 18 | 18 | ||
| 19 | - | return len(self._call_log[key]) > self._config.max_repeated_calls | |
| 19 | + | return len(self._call_log[key]) >= self._config.max_repeated_calls | |
| 20 | 20 | ||
| 21 | 21 | def reset(self) -> None: | |
| 22 | 22 | """Clear all recorded calls.""" |
The check that tells the two apart
fail→pass·tests/test_circuit_breaker.py::test_loop_detector_detects_loop
Check file tests/test_circuit_breaker.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it6c29cd9495ea354cf29dc0332aad3dd94ec98370
Broken version dated2026-03-15
Moduleagentbudget.circuit_breaker
Units changedLoopDetector
Fingerprint97099d96993bd0a3
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.