Why won't my agent stop?

A program ends when its code returns. An agent ends only when it decides the task is done, and deciding 'done' is a judgment the model is often bad at.

B

Balagei G Nagarajan

4 MIN READ


An AI agent walking an endless circular track that loops back on itself with no exit, the same glowing steps repeating around the ring
No explicit stopping criterion, no budget, the loop has no floor.
— from “Why won't my agent stop?”

Key facts.

  • Production teams treat unbounded loops as a real risk, not a corner case: in a large survey of agents in production, 68% are designed to run at most 10 steps before requiring human intervention, a deliberate cap rather than trusting the agent to stop itself (Measuring Agents in Production, arXiv:2512.04123, 2025).
  • The waste is enormous: an 8B agent averaged 26.4 unnecessary steps out of 40 in the ALFWorld benchmark, looping or issuing ineffective commands instead of stopping (Runaway is Ashamed, But Helpful, arXiv:2505.17616, 2025).
  • it's fixable cheaply: the same work shows that adding an early-exit signal, either an injected exit instruction or a verifier that checks task completion, cuts the redundant steps with negligible loss of performance (same paper, 2025).

Why agents don't know when they're done

Nothing told them how to know. A traditional program ends when its code returns. An agent runs a loop, think, act, observe, and the only thing that ends it is the agent deciding the task is complete. That's a judgment the model is often bad at. It can't reliably distinguish a finished task from an almost-finished one, so it keeps acting, re-checking, trying one more thing. No explicit stopping criterion, no budget, the loop has no floor. The agent re-reads state, re-calls tools, burns tokens long after the useful work is done. Failure taxonomies call this "unaware of termination." It's a top failure mode across frameworks.

What the loops look like

Three shapes, all expensive. First: the agent repeats the same step, same tool call, same arguments, same result, the most common multi-agent failure mode. Second: A-B-A oscillation, it undoes and redoes the same change, each step locally plausible. Third: padding with ineffective commands, never quite converging. In the ALFWorld benchmark, an 8B agent averaged 26.4 unnecessary steps out of 40. Most of its run was redundant. Every step is tokens spent, and with tools, real actions taken. That's how a stuck agent becomes a runaway bill and a pile of side effects.

A circular loop of four nodes with arrows going around and around with no exit arrow, one node highlighted to show a repeated action, and a faded missing 'done?' exit

How to make it stop

Give the loop a floor and a judge. The floor: a hard step or token budget. Cap iterations so a stuck agent fails loudly rather than running forever. The judge: a completion check that isn't the agent's own optimism, a verifier, a rule, or a separate model call that decides when the task is actually done and halts. Research shows both work, an intrinsic exit signal injected during generation and an extrinsic verifier that checks completion, and both cut redundant steps with negligible performance loss. Also add loop detection that catches a repeated identical action or A-B-A oscillation and breaks it, and a progress check that stops the agent if it hasn't advanced toward the goal in N steps. Those together turn "runs until it gives up or runs out of money" into "stops when done or when bounded."

An agent has no natural end, only the loop you wrap it in. A model that can't tell done from not-done will keep going until something stops it. Cap the steps, detect repeated and oscillating actions, check for real progress, let a verifier decide when the task is complete. None of that requires a bigger model, a bigger model loops just as confidently. It requires a control layer that knows when to stop, and that's what VibeModel builds as the Pattern Intelligence Layer.

Frequently asked questions

Will a more capable model know when it's done?
No stopping rule; a more capable model can't tell done from almost, so the runaway costs. (arXiv:2512.04123)

Why can't the model just decide when it's finished?
Because judging "done" is itself a hard call the model is often miscalibrated on. It can't reliably distinguish a finished task from a nearly-finished one, so left to itself it keeps acting. Failure taxonomies track this as "unaware of termination", a top failure mode.

Isn't a max-step limit enough?
It's the safety floor, always have one, but on its own it caps the waste rather than fixing it. Pair it with a completion verifier so the agent stops when the task is actually done, not only when it hits the ceiling.

How do I catch a loop early?
Watch for repeated identical actions and A-B-A oscillations, and run a progress check. If the agent hasn't moved toward the goal in the last few steps, break the loop and escalate. Most loops stop long before the step budget runs out.


Share this post

Join the discussion

Have a take, a war story, or a question? Sign in with GitHub to comment and react. Comments are powered by GitHub Discussions, ad-free and yours to moderate.

Continue Reading

Find where your agent breaks, before you build it

Faultmap maps where your agent will fail from the goal and your data, then hands you the first test suite it has to pass.