all answers

Research and benchmarks

Agent loops research

"When Agents Do Not Stop" (arXiv:2607.01641) is a study of agents that never finish. The authors call it an infinite agentic loop: the agent keeps calling a model, a tool, or another agent because nothing on that path ever tells it to stop. The cost is money, a context that grows until it breaks, and the same side effect repeated on an external system.

They wrote a tool that reads agent code, finds every place the code cycles, and checks whether each cycle has a limit that actually applies. Across 6,549 open-source agent repositories it flagged 74 cases, and 68 turned out to be real. The real ones come in a few shapes: retries with no cap, tool calls repeated with no cap, two agents talking with no turn limit, workflow steps that route back to themselves, and a runner and an evaluator feeding each other.

The useful finding is about turn limits. Most frameworks let you set one, and most of the confirmed loops were in code that had one. Developers leave it out, set it far too high, or put it somewhere the loop never passes through. A limit only stops a loop if it sits on the path that repeats, and someone has to know which path that is. So the practical check is not whether a limit exists, but whether the loop you're worried about would hit it.

8 questions

Answered, plainly.

How do you detect a looping agent in production?Watch for the shape a stuck loop leaves in a trace: the same tool or model call repeating near-identically while duration and cost climb well past normal.answer →Does a tool-call retry limit stop an agent from looping forever?Only if the limit sits on the exact call that repeats. Every one of a study's 68 confirmed loops had a bound somewhere in the code, just not on that path.answer →What does an unbounded retry loop cost?In a study of 68 confirmed cases, 95.6% drove API cost exhaustion and 95.6% tied up model capacity; 28% also blew out the context window.answer →Which agent patterns loop most often?Retry feedback with no bound on it is the single most common shape, in 25% of a study's 68 confirmed cases; tool-call iteration is close behind at 23.5%.answer →Can an agent's own recovery logic make a working run fail?Yes. A causal study found a smart recovery policy still broke 2 trajectories that would have succeeded for every 11 it rescued, a real harm rate hidden inside the average.answer →If you abort an agent that looks like it's failing, how often are you wrong?A 2026 real-time monitor can flag a failing agent trajectory early, but about 1 in 6 of the runs it aborts would actually have succeeded if left alone.answer →Can an LLM find infinite loops in agent code just by reading it?Not reliably: of 68 infinite agentic loops confirmed from a purpose-built scanner's alerts, a coding agent found 50 and a file-by-file LLM prompt found 23, both on gpt-5.5.answer →Does the model or the tool decide when an agent loop ends?Either can. In 68 confirmed infinite agentic loops, tool-controlled retry was the cause in 41.2% and model-controlled termination in 38.2%, and 23 had no exit at all.answer →

Try Tessary on Cloud.

free · 10,000 traces a month · 1 GB · 30-day retention · $10 one-time credit for triage and RCA · no credit card