Skip to content

fix(core): drop the third-identical-call veto from the turn loop - #225

Merged
Max17190 merged 1 commit into
mainfrom
remove-repeat-call-veto
Aug 19, 2026
Merged

fix(core): drop the third-identical-call veto from the turn loop#225
Max17190 merged 1 commit into
mainfrom
remove-repeat-call-veto

Conversation

@Max17190

@Max17190 Max17190 commented Aug 19, 2026

Copy link
Copy Markdown
Owner

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 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. The delegate skill's openmax-tmux wait needs 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 by max_agent_iterations and max_agent_tokens, which are budgets rather than a guess about the model.

Summary

  • Remove RepeatCallTracker and its plumbing from the serial and batch dispatch paths (agent.rs).
  • Collapse the now single-statement if executed { if mutating { into one condition; the large hunk in the diff is that re-indent (git diff -w shows the real change).

Test Plan

  • New identical_consecutive_calls_all_execute: a scripted endpoint returns the same bash call on every request; with max_agent_iterations = 4 all four calls execute and the turn ends at the iteration cap. Fails on the previous loop (calls three and four returned the veto text).
  • Reproduced the veto on the HEAD build against a mock endpoint before the change: three identical bash: date +%s%N; echo poll calls returned different timestamps and the third was refused.
  • cargo test --workspace green; cargo clippy --workspace --all-targets at 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 bash calls 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.

T-Rex T-Rex Logs

What T-Rex did

  • Ran cargo test -p open-max-core identical_consecutive_calls_all_execute --locked on the PR revision; the test completed with one passing test, four identical poll calls, and termination at max_iterations.
  • Compared the same focused test against the parent revision; the parent version vetoed calls 3 and 4 with the identical-call message, showing a regression difference from the PR.
  • Documented the exact reproduction workflow and results, including the before-PR reproduction script and log, and the after-PR focused-run script and log, which show the PR passes.
  • Linked and reviewed artifacts that support validation, including the scripts and logs for both the parent and PR revisions.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "fix(core): drop the third-identical-call..." | Re-trigger Greptile

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.
@Max17190
Max17190 merged commit dad10e7 into main Aug 19, 2026
4 checks passed
@Max17190
Max17190 deleted the remove-repeat-call-veto branch August 19, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant