# 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.

## Questions answered under this concept

- [Does a tool-call retry limit stop an agent from looping forever?](https://tessary.ai/answers/agent-loops-research/does-a-retry-limit-stop-an-agent-from-looping-forever)
- [How do you detect a looping agent in production?](https://tessary.ai/answers/agent-loops-research/how-do-you-detect-a-looping-agent-in-production)
- [What does an unbounded retry loop cost?](https://tessary.ai/answers/agent-loops-research/what-does-an-unbounded-retry-loop-cost)

---

Source: https://tessary.ai/answers/agent-loops-research
All concepts: https://tessary.ai/answers
From Tessary, agent reliability for AI agents in production: https://tessary.ai
