feat(core): note an identical call with an identical result to the model - #317
Merged
Merged
Conversation
A model that has finished can fail to stop: its reasoning says the task is complete, its reply is the same verification call again, the output is the same, and the turn runs to the iteration cap. Identical arguments alone mean nothing (#225), so nothing here vetoes a call and every call executes. What is tracked is the pair of call and result: from the third consecutive byte-identical pair, the tool message the model reads next carries an advisory note with the count that names both ways out, keep waiting or stop calling tools and answer. A reply with no calls resets the count.
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
A model that has finished can fail to stop: its reasoning says the task is complete, its reply is the same verification call again, the output is the same, and the turn runs to the iteration cap. On one full run of the release binary a fifth of all model turns repeated the previous turn's calls and results byte for byte, and one trial in eight ran to the cap that way. #225 removed a veto keyed on identical arguments because arguments say nothing about results and a stuck model is bounded by budgets; that reasoning stands, and this change vetoes nothing.
Summary
RepeatTrackerhashes each iteration's tool calls and the tool replies they drew. Every call still executes. From the third consecutive byte-identical pair, the tool message the model reads next carries an advisory note with the count that names both ways out: keep waiting, or stop calling tools and answer. A reply with no calls resets the count.Test Plan
identical_calls_with_identical_results_draw_a_note_from_the_third: five identicalread_filecalls; all five execute, replies one and two carry no note, three through five carry the note with the right count. Fails on main at the third reply.identical_calls_with_changing_results_draw_no_note: onebashcommand with fixed arguments whose output moves; no note on any reply.cargo test --workspace --lockedgreen;cargo +1.97.0 clippy --workspace --all-targets --locked -- -D warningsclean.Greptile Summary
Summary
Confidence Score: 5/5
Safe to merge: the repeated-call advisory behaves as intended for identical single-tool and multi-tool iterations, while changing results remain unannotated.
No issues were found. Executed checks covered the third-and-later advisory threshold, continued detection after prior advisory text was appended, multi-tool iterations, and changing-output polling.
Files Needing Attention: None.
What T-Rex did
Reviews (1): Last reviewed commit: "feat(core): note an identical call with ..." | Re-trigger Greptile