crbench//

← all cases

Rejecting a zero throttle interval silently stops an unthrottled heartbeat that must always fire

Tier 1 easy go · cross-file · authored, execution-grounded case

Ground-truth defects

d1 · correctness · high · limiter.go:12
The guard is tightened from `IntervalMs < 0` to `IntervalMs <= 0`, which reads like harmless input validation in the diff. But interval 0 means "unthrottled — fire on every call", and the unchanged consumer heartbeat.go deliberately builds a Limiter with interval 0 so its keepalive beats on every tick. Folding 0 into the rejected case makes that heartbeat never beat. The diff looks reasonable alone; the bug is only knowable by reading the unchanged heartbeat.go to see that interval 0 is an intended, load-bearing configuration.

The change under review

diff
diff --git a/limiter.go b/limiter.go
index 40ab652..cade530 100644
--- a/limiter.go
+++ b/limiter.go
@@ -9,7 +9,7 @@ type Limiter struct {
 
 // Allow reports whether the action may fire at nowMs.
 func (l *Limiter) Allow(nowMs int64) bool {
-	if l.IntervalMs < 0 {
+	if l.IntervalMs <= 0 {
 		return false
 	}
 	return l.advance(nowMs)

Leaderboard for this case

easy · 9 of 9 bots fully caught it (100% solve rate) · 100% avg coverage.

#BotResultCaughtCoverageFindingsFalse alarms
1 Claude Code (Opus 5.5) solved 1/1 100.0% 1 0
2 Cubic solved 1/1 100.0% 1 0
3 cursor solved 1/1 100.0% 1 0
4 Drape (Deep Review) solved 1/1 100.0% 1 0
5 Drape (Review) solved 1/1 100.0% 1 0
6 greptile solved 1/1 100.0% 1 0
7 Mjolnir (Opus 5.5) solved 1/1 100.0% 2 0
8 Mjolnir (Sonnet 5.5) solved 1/1 100.0% 2 0
9 qodo solved 1/1 100.0% 1 0

Bot results

Claude Code (Opus 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
raw comments (1)
limiter.go:12
Changing the guard from `< 0` to `<= 0` makes `Allow` return false when `IntervalMs == 0`. Before this change, an interval of 0 meant 'unthrottled': `advance` always passed because `nowMs-last >= 0`. `NewHeartbeat` in heartbeat.go builds `Limiter{IntervalMs: 0}` and relies on that meaning, so with this change `Heartbeat.Tick` never returns true and no keepalive beats are sent, which can cause connection or liveness timeouts.
Cubic · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
raw comments (2)
limiter.go:12
<!-- cubic:v=d9fdcd89-4170-4cd7-8934-af3055edc57d --> <!-- cubic:review-run=6e3d5900-cf92-59ca-869c-74215c2ff066 --> <!-- metadata:{"confidence":10} --> P1: When `Heartbeat` uses its documented zero interval, `Allow` now returns false on every call, so keepalive beats are completely suppressed. Keep zero as the unthrottled case and reject only negative intervals. <details> <summary>Prompt for AI agents</summary> ```text Check if this issue is valid — if so, understand the root cause and fix it. At limiter.go, line 12: <comment>When `Heartbeat` uses its documented zero interval, `Allow` now returns false on every call, so keepalive beats are completely suppressed. Keep zero as the unthrottled case and reject only negative intervals.</comment> <file context> @@ -9,7 +9,7 @@ type Limiter struct { // Allow reports whether the action may fire at nowMs. func (l *Limiter) Allow(nowMs int64) bool { - if l.IntervalMs < 0 { + if l.IntervalMs <= 0 { return false } </file context> ``` </details>
PR-level
<!-- cubic:review-summary:start --> **1 issue found** across 1 file <!-- cubic:review-summary:end --> <details> <summary>Prompt for AI agents (unresolved issues)</summary> ```text Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately. <file name="limiter.go"> <violation number="1" location="limiter.go:12"> P1: When `Heartbeat` uses its documented zero interval, `Allow` now returns false on every call, so keepalive beats are completely suppressed. Keep zero as the unthrottled case and reject only negative intervals.</violation> </file> ``` </details> <sub>Reply with feedback, questions, or to request a fix.<br /><br />[Re-trigger cubic](https://www.cubic.dev/action/re-review/pr/drape-io/crbench-cubic-2026-09/3/ai_pr_review_github_delivery_353175632c5d4e54cf4005858aa4da7d523570ab21c5fc5cd483cb6cc6e3fab0?returnTo=https%3A%2F%2Fgithub.com%2Fdrape-io%2Fcrbench-cubic-2026-09%2Fpull%2F3)</sub> <!-- cubic:review-post:ai_pr_review_github_delivery_353175632c5d4e54cf4005858aa4da7d523570ab21c5fc5cd483cb6cc6e3fab0:538cac9b1d655cd574a7b1d3422224f7ed129269:6e3d5900-cf92-59ca-869c-74215c2ff066 -->
cursor · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
raw comments (2)
limiter.go:12
### Zero interval now always denies **High Severity** <!-- DESCRIPTION START --> Tightening the guard from `< 0` to `<= 0` makes a zero `IntervalMs` deny every call. `NewHeartbeat` constructs a limiter with interval 0 so beats are never suppressed, so `Tick` now never emits a beat. <!-- DESCRIPTION END --> <!-- BUGBOT_BUG_ID: ff20d05b-a2fd-4fb4-906d-32835da8d4ea --> <!-- LOCATIONS START limiter.go#L11-L13 LOCATIONS END --> <div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmU5ZjBmZjBmLTkxM2EtNDhlOC1hNjNkLTlhODIxZWM1Y2Y0ZSIsImVuY3J5cHRpb25LZXkiOiIyTDhWbk11WXgyN2NzOGVnaEtGY1lnMl9wQmJ0OUdMMnBWNUFhREVLV2hvIiwiYnJhbmNoIjoidDEtZ28temVyby1pbnRlcnZhbC1uZXZlci1maXJlcyIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJvdmlkZXIiOiJnaXRodWIifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmU5ZjBmZjBmLTkxM2EtNDhlOC1hNjNkLTlhODIxZWM1Y2Y0ZSIsImVuY3J5cHRpb25LZXkiOiIyTDhWbk11WXgyN2NzOGVnaEtGY1lnMl9wQmJ0OUdMMnBWNUFhREVLV2hvIiwiYnJhbmNoIjoidDEtZ28temVyby1pbnRlcnZhbC1uZXZlci1maXJlcyIsInJlcG9Pd25lciI6ImRyYXBlLWlvIiwicmVwb05hbWUiOiJjcmJlbmNoLWN1cnNvci0yMDI2LTA5IiwicHJOdW1iZXIiOjMsImNvbW1pdFNoYSI6IjJiM2VjMzRhNGRiZTcxOTk5MTIxZGIyNjUzNGUwOTZjNjFmNDhiZGEiLCJwcm92aWRlciI6ImdpdGh1YiJ9fQ" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 2b3ec34a4dbe71999121db26534e096c61f48bda. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
PR-level
<!-- BUGBOT_REVIEW --> Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue. <!-- BUGBOT_FIX_ALL --> <a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9BTExfSU5fQ1VSU09SIiwiZGF0YSI6eyJyZWRpc0tleSI6ImJ1Z2JvdC1tdWx0aTo1NTlkODMwYy02MTNlLTQxMTItOTcwYS1iNDBhODgyMWIwOTEiLCJlbmNyeXB0aW9uS2V5Ijoib0w5U3pSX3JQcE5Rc3lHeXlkQWtXMTBVLTdsQnZrdHFtTkRkd2hsMlp0NCIsImJyYW5jaCI6InQxLWdvLXplcm8taW50ZXJ2YWwtbmV2ZXItZmlyZXMiLCJyZXBvT3duZXIiOiJkcmFwZS1pbyIsInJlcG9OYW1lIjoiY3JiZW5jaC1jdXJzb3ItMjAyNi0wOSIsInByb3ZpZGVyIjoiZ2l0aHViIn19" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix All in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a> <!-- /BUGBOT_FIX_ALL --> <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_BEGIN --> <sup>❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot).</sup> <!-- BUGBOT_AUTOFIX_REVIEW_FOOTNOTE_END --> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 2b3ec34a4dbe71999121db26534e096c61f48bda. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
Drape (Deep Review) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
raw comments (1)
limiter.go:12
**Zero interval now blocks every call, killing heartbeats** With `IntervalMs` of 0, `Allow` now always returns false instead of always allowing. `NewHeartbeat` relies on interval 0 meaning "unthrottled", so every `Tick` now returns false and no keepalive beat is ever sent. Restore the `< 0` check so a zero interval stays unthrottled. ``` limiter.go:12 if l.IntervalMs <= 0 { heartbeat.go:3 // Heartbeat emits a keepalive beat on every tick. It is built with a zero throttle interval so the heartbeat.go:4 // beats are never suppressed: an unthrottled limiter must allow the action on every call. heartbeat.go:9 // NewHeartbeat returns an unthrottled heartbeat (interval 0 = beat on every tick). heartbeat.go:10 func NewHeartbeat() *Heartbeat { heartbeat.go:11 return &Heartbeat{lim: &Limiter{IntervalMs: 0}} limiter.go:20 if !l.hasLast || nowMs-l.last >= l.IntervalMs { ```
Drape (Review) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
raw comments (1)
limiter.go:12
**Zero interval now blocks every call** Changing `< 0` to `<= 0` makes `Allow` return false for IntervalMs == 0. Zero meant unthrottled (always allow), and `NewHeartbeat` depends on that. Restore the `< 0` check, or handle 0 as always-allow explicitly. ``` limiter.go:12 if l.IntervalMs <= 0 { heartbeat.go:3 // Heartbeat emits a keepalive beat on every tick. It is built with a zero throttle interval so the heartbeat.go:4 // beats are never suppressed: an unthrottled limiter must allow the action on every call. limiter.go:20 if !l.hasLast || nowMs-l.last >= l.IntervalMs { ```
greptile · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
raw comments (2)
limiter.go:14
<a href="#"><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> **Zero Interval Blocks Heartbeats** `NewHeartbeat` intentionally uses a zero interval so every tick is allowed. This new `<= 0` guard returns `false` before `advance` runs, causing `Heartbeat.Tick` to reject every tick instead of firing each time. ```suggestion if l.IntervalMs < 0 { return false } ```
PR-level
<h3>Greptile Summary</h3> This PR changes `Limiter.Allow` so zero intervals are rejected alongside negative intervals. - This conflicts with the existing zero-interval unthrottled behavior used by `Heartbeat`. - No security issues were identified. <h3>Confidence Score: 4/5</h3> This PR is not safe to merge because it prevents the existing heartbeat implementation from firing. `NewHeartbeat` intentionally uses a zero interval to allow every tick, while the changed guard now returns false for every such call. **Files Needing Attention:** limiter.go <details><summary><h3>Important Files Changed</h3></summary> | Filename | Overview | |----------|----------| | limiter.go | Changes the interval guard in a way that permanently suppresses callers relying on the documented zero-interval mode. | </details> <!-- greptile_other_comments_section --> <sub>Reviews (1): Last reviewed commit: ["Update limiter.go"](https://github.com/drape-io/crbench-greptile-2026-09/commit/ef53e36da2f04b82484575c4b5626738b092c094) | [Re-trigger Greptile](https://app.greptile.com/api/retrigger?id=64284078)</sub>
Mjolnir (Opus 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · impact high
NewHeartbeat builds a Limiter with IntervalMs: 0. Before this change, the `< 0` guard let a zero interval through to advance, and advance allowed every call. With the new `<= 0` guard, Allow always returns false for a zero interval, so Heartbeat.Tick never produces a beat. [grounded: diff] [consensus 3/3: valid=3]
valid · matches d1 · impact high
raw comments (2)
limiter.go:12
[P1] Zero interval now blocks every call, which silences Heartbeat Changing the guard from `‹ 0` to `‹= 0` makes `Allow` return false whenever `IntervalMs == 0`. `NewHeartbeat` in heartbeat.go builds its limiter as `&Limiter{IntervalMs: 0}` and says that interval 0 means "beat on every tick". After this change, `Heartbeat.Tick` always returns false, so no keepalive beat is ever sent. Before the change, a zero interval went through `advance`, where `nowMs-l.last ›= 0` is true on every call, so each call was allowed. Only negative intervals should be rejected here.
limiter.go:12
[P1] Zero interval now blocks every call, which silences Heartbeat Changing the guard from `‹ 0` to `‹= 0` makes `Allow` return false on every call when `IntervalMs == 0`. Before this change, an interval of 0 meant "unthrottled": `advance` always passed because `nowMs-l.last ›= 0`. `NewHeartbeat` in heartbeat.go builds its limiter with `IntervalMs: 0`, and its comments say an unthrottled limiter must allow the action on every call. With this change, `Heartbeat.Tick` never returns true, so no keepalive beats are ever sent. Callers that use 0 to mean "no throttle" are silently switched to "never fire".
Mjolnir (Sonnet 5.5) · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
valid · impact high
Before the change, a zero interval went on to advance(), and since nowMs-last >= 0 it fired on every call. Now Allow returns false whenever IntervalMs is 0, so NewHeartbeat (IntervalMs: 0) never beats, even though its comment says an unthrottled limiter must allow every call. [grounded: diff] [consensus 3/3: valid=3]
raw comments (2)
limiter.go:12
[P1] Zero interval now blocks every call, so Heartbeat never beats Changing the guard from `‹ 0` to `‹= 0` makes `Allow` return false for `IntervalMs == 0`. `NewHeartbeat` in heartbeat.go:10-12 builds `&Limiter{IntervalMs: 0}`, and its doc comment says an unthrottled limiter must allow the action on every call. With this change `Heartbeat.Tick` always returns false, so keepalive beats are never emitted. Before the change, a zero interval fell through to `advance`, where `nowMs-l.last ›= 0` is true for monotonic times, so every call fired. Any other caller that uses a zero interval to mean "no throttling" is broken the same way. If the aim was to reject invalid intervals, only negative values should be rejected and zero should still reach `advance`.
limiter.go:12
[P1] Zero interval now blocks every call, silencing Heartbeat Changing `IntervalMs ‹ 0` to `‹= 0` makes `Allow` return false for a zero interval, so such a limiter never fires. `NewHeartbeat` in heartbeat.go:11 builds `Limiter{IntervalMs: 0}`, and its doc comment says an unthrottled limiter must allow the action on every call. With this change `Heartbeat.Tick` always returns false, so no keepalive beat is ever emitted. Before the change, a zero interval fell through to `advance`, where `nowMs-l.last ›= 0` is true for monotonic time, so it fired on every call. Any other caller that uses `IntervalMs == 0` to mean "no throttle" is broken the same way. Only negative intervals should be rejected.
qodo · cross-file engine perris 0.11.1+proven.tiered0.25.call.read.subclass.type
DefectSeverityFoundGrade
d1 high ✓ exact
valid · matches d1 · impact high
raw comments (3)
limiter.go:13
<img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required"> 1\. Heartbeats stop emitting on every tick <code>🐞 Bug</code> <code>≡ Correctness</code> <pre> <b><i>Limiter.Allow</i></b> now returns <b><i>false</i></b> whenever <b><i>IntervalMs</i></b> is zero, so the zero-interval limiter never reaches <b><i>advance</i></b>. <b><i>NewHeartbeat</i></b> deliberately constructs a limiter with <b><i>IntervalMs: 0</i></b>, causing every <b><i>Heartbeat.Tick</i></b> call to report that no beat was produced. </pre> <details> <summary><strong>Agent Prompt</strong></summary> ``` ## Issue description `Limiter.Allow` now rejects `IntervalMs == 0`, but `NewHeartbeat` uses a zero interval to represent an unthrottled heartbeat. As a result, every `Heartbeat.Tick` call returns false and no keepalive beats are emitted. ## Fix Focus Areas - limiter.go[12-13] - heartbeat.go[3-16] ## Recommended Fix Restore zero-interval behavior so an interval of zero allows every call, or change the heartbeat construction and limiter API to use an explicit unthrottled mode. Keep negative intervals disabled if that remains the intended invalid configuration behavior, and add tests covering both zero-interval heartbeats and negative intervals. ``` <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> </details>
PR-level
<h3>Code Review by Qodo</h3> <code>🐞 Bugs (1)</code> <code>📘 Rule violations (0)</code> <code>📜 Skill insights (0)</code> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <br/> <img src="https://img.shields.io/badge/High-634FD1?style=flat-square" height="20px" alt="Action required"> <details> <summary> 1. Heartbeats stop emitting on every tick <code>🐞 Bug</code> <code>≡ Correctness</code></summary> <br/> > <details open> ><summary>Description</summary> ><br/> > ><pre> ><b><i>Limiter.Allow</i></b> now returns <b><i>false</i></b> whenever <b><i>IntervalMs</i></b> is zero, so the zero-interval limiter >never reaches <b><i>advance</i></b>. <b><i>NewHeartbeat</i></b> deliberately constructs a limiter with <b><i>IntervalMs: 0</i></b>, >causing every <b><i>Heartbeat.Tick</i></b> call to report that no beat was produced. ></pre> ></details> > <details> ><summary>Code</summary> ><br/> > ><code>[limiter.go[R12-13]](https://github.com/drape-io/crbench-qodo-2026-09/pull/3/files#diff-c3f1fd6fa2457438e1cd957eea2ba705f9825a4b6e3ad3fa55e3e03be05dea05R12-R13)</code> > >```diff >+ if l.IntervalMs <= 0 { > return false >``` ></details> > <details> ><summary>Agent prompt</summary> ><br/> > >``` >The issue below was found during a code review. Follow the provided context and guidance below and implement a solution > >## Issue description >`Limiter.Allow` now rejects `IntervalMs == 0`, but `NewHeartbeat` uses a zero interval to represent an unthrottled heartbeat. As a result, every `Heartbeat.Tick` call returns false and no keepalive beats are emitted. > >## Fix Focus Areas >- limiter.go[12-13] >- heartbeat.go[3-16] > >## Recommended Fix >Restore zero-interval behavior so an interval of zero allows every call, or change the heartbeat construction and limiter API to use an explicit unthrottled mode. Keep negative intervals disabled if that remains the intended invalid configuration behavior, and add tests covering both zero-interval heartbeats and negative intervals. >``` > <code>ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools</code> ></details> <hr/> </details> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <!-- qodo-context:start --> <details><summary><strong>Context sources</strong></summary> <div>Review mode: <code>🚀 Fast</code>: This is a single-line behavioral fix localized to limiter interval validation, with low blast radius and no high-risk area involved.</div> <!-- qodo-context:end --> </details> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <!-- qodo-daily-tip:start --> <details> <summary><strong>Tip of the day</strong></summary> <br/> <pre>💡 Did you know, you can reply &#x27;qodo&#x27; on any finding to push back, ask questions, or dig deeper</pre> <a href="https://docs.qodo.ai/tips-and-tricks">More tips ↗</a> | <a href="https://app.qodo.ai/configurations?tab=display-preferences">Customize Qodo ↗</a> | <a href="https://docs.qodo.ai">Qodo docs ↗</a> </details> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <!-- qodo-daily-tip:end --> <!-- https://github.com/drape-io/crbench-qodo-2026-09/commit/7269e01c7a0b6e485de26ba5b221808634f16a7a --> <a href="https://www.qodo.ai"><img src="https://www.qodo.ai/wp-content/uploads/2025/03/qodo-logo.svg" width="80" alt="Qodo Logo"></a>
PR-level
<h3>PR Summary by Qodo</h3> Prevent zero-interval limiters from firing <code>🐞 Bug fix</code> <code>🕐 Less than 10 minutes</code> <img src="https://www.qodo.ai/wp-content/uploads/2025/11/light-grey-line.svg" height="10%" alt="Grey Divider"> <details> <summary>AI Description</summary> <dl> <dd> <br/> ><pre> >• Treat zero and negative intervals as disabled limiter configurations. >• Prevent disabled limiters from recording or allowing actions. ></pre> </dd> </dl> </details> <details> <summary>Diagram</summary> <dl> <dd> <br/> ```mermaid graph TD Caller["Limiter caller"] --> Allow["Allow call"] --> Check{"Positive interval"} -->|Yes| Advance["Advance window"] Check -->|No| Reject["Return false"] ``` </dd> </dl> </details> <details> <summary>High-Level Assessment</summary> <dl> <dd> <br/> >The following are alternative approaches to this PR: <details> <summary><b>1. Explicit disabled state</b></summary> <dl> <dd> - ➕ Avoids overloading zero with disabled semantics - ➕ Makes configuration intent clear to callers - ➖ Expands the limiter API and state - ➖ Requires migration of existing struct literals </dd> </dl> </details> <details> <summary><b>2. Constructor validation</b></summary> <dl> <dd> - ➕ Centralizes interval semantics - ➕ Can reject invalid configurations before runtime - ➖ Public fields still permit bypassing validation - ➖ Requires broader caller changes than the current guard </dd> </dl> </details> >**Recommendation:** The inline guard is the smallest implementation if non-positive intervals are formally defined as disabled. However, existing callers and documentation should be reconciled because zero may currently represent an unthrottled limiter; add focused tests and update those contracts before merging. </dd> </dl> </details> <details> <summary> Files changed (1) <code> +1 / -1 </code> </summary> <dl> <dd> <br/> <details> <summary>Bug fix (1) <code> +1 / -1 </code></summary> <dl> <dd> <details> <summary>limiter.go<code>Reject zero-interval limiter requests</code> <code>+1/-1</code></summary> <br/> >Reject zero-interval limiter requests > ><pre> >• Expands the disabled-interval guard from negative values to all non-positive values. A limiter configured with zero now always returns false without advancing its state. ></pre> > ><a href='https://github.com/drape-io/crbench-qodo-2026-09/pull/3/files#diff-c3f1fd6fa2457438e1cd957eea2ba705f9825a4b6e3ad3fa55e3e03be05dea05'>limiter.go</a> </details> </dd> </dl> </details> </dd> </dl> </details>