My Agent Looped 50 Times on the Same Broken Tool Call
I was running coding agents in parallel and noticed something strange in the failure logs. One session had called the same tool 50 times in a row, each time with the same missing parameter, each time getting the same error back.
The model knew it was stuck. It literally wrote "I've failed 17 consecutive times with the exact same error" and then proceeded to make the same error again.
What eventually worked was not a better prompt. We embedded a JSON template of the correct tool call format directly into the error message. The agent stopped looping because it finally had a concrete example of what
"correct" looked like, not just a description of what was wrong.
Has anyone else seen agents loop on tool calls? What actually broke the pattern for you?
Replies
Be the first to reply
Have a question or a thought to share? Add a comment above to start the conversation.