fix(core): drop the third-identical-call veto from the turn loop - #225
Merged
Conversation
The loop refused the third consecutive tool call with identical arguments and told the model "the result will not change". Arguments say nothing about results: a `wait` on a delegated child that times out at the bash cap, a `git status` while a build runs, a log tail all repeat verbatim while their output moves, and the delegate skill's `openmax-tmux wait` needs exactly this shape for any child running past ten minutes. The veto was added for small local models that loop; a stuck model is already bounded by max_agent_iterations and max_agent_tokens, which are budgets rather than a guess about the model. The regression test drives four identical `bash` calls through a scripted endpoint and asserts every one executes; it fails on the previous loop, where calls three and four were vetoed.
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.
Why
The turn loop refused the third consecutive tool call with identical arguments and told the model "the result will not change." Arguments say nothing about results: a
waiton a delegated child that times out at the bash cap, agit statuswhile a build runs, a log tail all repeat verbatim while their output moves. The delegate skill'sopenmax-tmux waitneeds exactly this shape for any child running past ten minutes (300 s bash cap, three identical waits), and the third was vetoed with a false message. The veto was added for small local models that loop; a stuck model is already bounded bymax_agent_iterationsandmax_agent_tokens, which are budgets rather than a guess about the model.Summary
RepeatCallTrackerand its plumbing from the serial and batch dispatch paths (agent.rs).if executed { if mutating {into one condition; the large hunk in the diff is that re-indent (git diff -wshows the real change).Test Plan
identical_consecutive_calls_all_execute: a scripted endpoint returns the samebashcall on every request; withmax_agent_iterations = 4all four calls execute and the turn ends at the iteration cap. Fails on the previous loop (calls three and four returned the veto text).bash: date +%s%N; echo pollcalls returned different timestamps and the third was refused.cargo test --workspacegreen;cargo clippy --workspace --all-targetsat zero warnings.Greptile Summary
This change removes the third-identical-tool-call veto so polling operations can continue when their arguments remain stable. The repeated-call flow was exercised against a scripted endpoint: four identical
bashcalls completed successfully, and the configured iteration limit ended the turn after the fourth call. The concern that removing the veto could allow repeated calls to continue past the configured limit was disproved by this execution.Confidence Score: 5/5
The change is safe to merge based on the exercised repeated-call and termination behavior.
The focused regression execution covered repeated identical calls, successful tool results, endpoint request counting, and termination at the configured iteration limit. The same test distinguishes the previous behavior, where later calls were rejected by the removed veto.
Files Needing Attention: No additional files need attention; the reviewed behavior is contained in
crates/core/src/agent.rs.What T-Rex did
Reviews (1): Last reviewed commit: "fix(core): drop the third-identical-call..." | Re-trigger Greptile