Repository navigation
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AgentScope-Java Version
2.1.0-SNAPSHOT
Description
Fixes #4148. With a model repeatedly requesting the same local tool and arguments, both
call()andstreamEvents()execute the tool four times whenmaxIters=4. That remains the default. Applications can opt in toRepetitionGuardMiddlewareto warn the model and stop before dispatching another identical request.The guard tracks consecutive calls within a single invocation. It ignores call IDs and JSON object key order, preserves array order, and supports tool-name exclusions for polling. Permission checks run first. At the stop threshold the entire not-yet-dispatched batch is skipped, its calls are accounted for, and both entry points return
REPEATED_TOOL_CALL. For example, thresholds of 2 and 3 allow two tool executions, warn before the next reasoning step, and block the third execution.Verified with a local mock model and a counting tool, without provider credentials. All 12 focused cases passed, including permission confirmation, external tools, batch receipts, and isolation across overlap, cancellation and subsequent turns. Full Maven reactor verification passed (114 modules); the documentation tests, build validation, and link checks also passed.
Checklist
mvn spotless:applymvn verify(environment-dependent skips remain)