Skip to content
This repository was archived by the owner on Aug 25, 2026. It is now read-only.

fix: count validation-rejected tool calls toward repeat breaker (v1+v2) - #9

Merged
YaseenHQ merged 2 commits into
mainfrom
upstream-port/repeat-breaker
Aug 8, 2026
Merged

YaseenHQ merged 2 commits into
mainfrom
upstream-port/repeat-breaker

Conversation

@YaseenHQ

@YaseenHQ YaseenHQ commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Related Issue

Upstream port batch 2 of 6. Ports the validation-rejected-tool-call repeat-breaker fix to both engines.

What changed

Without this fix, when the model issues a tool call whose arguments fail validation, the rejected call was never registered with the repeat breaker. The model could then re-issue the same malformed call indefinitely until maxSteps, looping forever.

Verification

  • Typecheck clean: agent-core, agent-core-v2
  • Tests pass: agent-core 4016, agent-core-v2 4216
  • Regenerated state-manifest.d.ts (the only conflict — a generated brand counter) via gen:state-manifest.

Checklist

  • Tests pass on both engines.

starquakee and others added 2 commits August 3, 2026 05:38
…at breaker (MoonshotAI#2313)

* fix(agent-core): count validation-rejected tool calls toward the repeat breaker

Args-rejected calls returned before prepareToolExecution, so the breaker
never counted them and the model could re-issue the same invalid call
until maxSteps. Register them in finalizeToolResult so reminders fire at
3/5/8 and the turn force-stops at 12.

* fix(agent-core): key parse-failed repeats on raw argument text

Malformed JSON arguments normalize to {} on parse failure, which keyed
every malformed-but-different attempt identically and could force-stop a
turn whose calls were evolving rather than identical. Register skipped
calls on the raw arguments text when parsing failed.

---------

Co-authored-by: fengchenchen <fengchenchen@moonshot.ai>
…epeat breaker (MoonshotAI#2317)

* fix(agent-core-v2): count validation-rejected tool calls toward the repeat breaker

* style(agent-core-v2): remove inline implementation comments
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@YaseenHQ, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6b45df8a-416e-4b67-872d-29849d3c7d0e

📥 Commits

Reviewing files that changed from the base of the PR and between a239aa0 and 2512022.

📒 Files selected for processing (14)
  • .changeset/dedup-register-rejected-calls.md
  • .changeset/v2-dedup-register-rejected-calls.md
  • packages/agent-core-v2/docs/state-manifest.d.ts
  • packages/agent-core-v2/src/agent/toolDedupe/toolDedupeService.ts
  • packages/agent-core-v2/src/agent/toolExecutor/toolExecutorService.ts
  • packages/agent-core-v2/src/agent/toolExecutor/toolHooks.ts
  • packages/agent-core-v2/src/tool/tool-args-parse.ts
  • packages/agent-core-v2/test/agent/toolDedupe/toolDedupe.test.ts
  • packages/agent-core-v2/test/agent/toolExecutor/toolExecutor.test.ts
  • packages/agent-core-v2/test/agent/toolSelect/toolSelectService.test.ts
  • packages/agent-core/src/agent/turn/index.ts
  • packages/agent-core/src/agent/turn/tool-dedup.ts
  • packages/agent-core/test/agent/turn.test.ts
  • packages/agent-core/test/agent/turn/tool-dedup.test.ts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@YaseenHQ
YaseenHQ merged commit ab30fa6 into main Aug 8, 2026
15 checks passed
@github-actions github-actions Bot mentioned this pull request Aug 11, 2026
@YaseenHQ
YaseenHQ deleted the upstream-port/repeat-breaker branch August 24, 2026 23:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants