The run finished. No exception, no timeout, no failed span, no alert. Two hundred and twenty-seven seconds, 192 spans, 50 orchestrator iterations, and 43 calls to the same tool — every one of them green. On the dashboards most teams actually watch, that trace is a slow request, not a bug.
The numbers are from Arize's August 2026 write-up on Alyx, their own production agent. They are worth borrowing because almost nobody publishes this: a trace-review agent run over thirty days of production traffic surfaced 34 issues, and two of them were retry loops that ordinary monitoring had classified as valid activity for weeks. Neither loop involved a failed tool call. That is precisely why nothing caught them.
What makes this worth a post rather than a bookmark is the shape of the two root causes. Neither was a reasoning failure, a bad prompt, or a model that needed upgrading. In both cases a tool answered "try again" about a state that was never going to change, and the model did exactly what it was told. We have been fixing the same shape on agents we run, and the fix is almost never in the prompt.
The iteration cap is a bill, not a guardrail
Every agent framework ships a ceiling, and most teams believe it is their loop protection. It is not. It is a cost backstop that fires after the money is spent, and the defaults have been moving in a direction that makes that worse.
LangGraph is the clearest example because the change is public. The Python default recursion_limit was 25 for most of the library's life; version 1.0.6 raised it sharply, and the documentation and the code still disagree about by how much. The Graph API docs say 1,000 steps. config.py at the 1.0.6 tag reads 10,000. By March it was 10,007, and there is an open issue on the docs repo about exactly this gap. Neither number is wrong for everyone — that is the point. A ceiling is a budget decision, and no library can make it for you.
Both ends of that range fail you in different directions. At 25 the cap is a false positive generator: a five-cycle ReAct agent making five tool calls per cycle hits exactly 25 while doing honest work, so teams raise it, and raising it is the correct response. At 10,000 it is not a guardrail in any meaningful sense — it is the number of model calls you are willing to pay for before someone notices. And when it finally trips you get a GraphRecursionError, which tells you the agent stopped. It does not tell you that the agent had stopped making progress forty-five iterations earlier.
Keep the cap. Set it deliberately, per workflow, based on the longest legitimate trajectory you have measured. Then stop treating it as the safety mechanism, because the question it answers — "has this gone on too long?" — is not the question you need answered.
A recoverable error is a retry instruction
The first Alyx loop: a call to todo_update with a status the task already had. The tool raised a recoverable exception. The harness did what harnesses do with recoverable exceptions — fed the message back to the model as context so it could correct itself. The model's only lever for correcting a todo_update failure is calling todo_update. Nothing about the task had changed, so the next call was identical, and so was the one after it.
It is tempting to read that as a dumb model. It is not. "Recoverable" is an explicit contract that says this failed and you may be able to fix it by trying something. The model was handed an error class whose entire semantic meaning is retry, about a condition that retrying cannot affect. Forty-three times is not the model being stubborn; it is the model being obedient to a tool that lied about its own failure mode.
The repair belongs in the tool. A write whose desired end state already holds is a success, and it should return the state rather than an objection to being asked.
The changed: false field is doing real work and is worth arguing for separately. Returning a bare success hides information the orchestrator wants later; returning the full list gives the model ground truth instead of a description of ground truth. Both matter, and the second one matters more than it looks — a model that is told "that already happened" still has to believe it, whereas a model handed the current list can simply read it.
None of this is new. It is the idempotency rule that HTTP has had since PUT and DELETE were specified, the one a migration ledger relies on, the one our own job queue follows when a worker claims a batch and finds nothing to do: that run is marked done, not failed, because a worker that errors on "nothing to do" gets retried forever by its own backoff. Agents did not invent the bug. They made each violation cost a model call.
Normalise before you validate
The second loop had a different trigger and an identical shape. An optional argument arrived empty, schema validation rejected the call, and the rejection came back with helpful guidance about what to supply. The model supplied something — an empty string, the word none, an N/A — and got rejected again. Every attempt consumed a turn and moved nothing.
Validation guidance is the part that turns a bad input into a loop. A rejection that says "field X is required" to a model that does not have a value for X is an invitation to invent one, and models are extremely good at inventing plausible filler. The guidance is honest and the loop is still the result.
So we run a normalisation pass between the model's arguments and the schema. It is boring code and it removes a whole category of turn-burning rejection.
The second half of this rule is about rejections you cannot normalise away. When a call genuinely cannot succeed, the result must not read as retryable. Say what is wrong, say that calling again will not help, and name the other actions available. A terminal failure dressed as a recoverable one is the same bug as the todo_update case wearing a different hat.

Progress is a state hash, not an iteration count
Tool fixes close the loops you already know about. Detection is what catches the next one, and the standard recipe — hash the tool name and its canonicalised arguments, flag the hash that repeats — is half right. It is the half that is easy to instrument and the half that gives you a detector which never fires.
- Volatile arguments silently disable it.One request id, one timestamp, one nonce in a tool’s argument object and every hash is unique forever. The detector reports zero loops, which is indistinguishable from working, and this is the single most common way argument hashing fails in production.
- Honest repetition looks identical to it.Polling a job, walking a cursor, retrying a genuine 503 — all of these repeat a call deliberately. Flag them and someone turns the detector off within a week, which is worse than never having shipped it.
- Iteration counts measure effort, not travel. Fifty iterations is a fine number for a research task and a catastrophe for a status update. The threshold that is right for both does not exist.
What survives all three is a fingerprint that includes the world, not just the request. We hash the tool name, the canonicalised arguments with volatile keys stripped, and a state revision that only increments when a write actually changed something — which is exactly what changed: true from the first code block gives us for free.
Two details in there are the ones we argue about on every implementation. The reprompt carries a state snapshot rather than an instruction, because "you are repeating yourself" is another thing the model has to take on faith while the current task list is something it can read. And the halt emits a labelled counter, because agent.no_progress_halt by tool name is the only metric in this whole post that will tell you which tool to fix next without reading a single trace.
Paging through results, polling an async job, retrying a transient 503 — these repeat the same call on purpose, and an arguments-only detector flags every one of them. The discriminator is the state revision: a cursor walk changes what the agent has, a poll changes whether the job is done, a genuine retry eventually changes the result. A loop changes nothing, which is why _unchanged state_ has to be part of the fingerprint rather than a heuristic bolted on beside it.
The trace is the fixture
Every loop you find is a test you now have the inputs for, and this is the step teams skip. The fix ships, the trace gets closed, and three prompt revisions later something structurally identical appears somewhere else in the tool surface.
Replay the tool sequence from the production trace, not the model turns. Model outputs are nondeterministic and will make the test flaky within a sprint; the tool contract is deterministic and is the thing that actually broke. Three assertions cover the cases in this post: a same-state write returns success with changed: false, a blank optional argument is accepted rather than bounced, and a synthetic sequence of identical calls against frozen state halts at the third.
Resist the temptation to let a model judge this. We learned it on a different pipeline, asking one model to review its own output: a second pass from the same model gives you a second answer, not a second opinion. Loop detection has to be deterministic code outside the model, for the same reason a circuit breaker is not implemented inside the thing it protects.
What we check before an agent runs unattended
- 1Every write tool is a no-op on its own end state. Walk the tool list and ask one question per tool: what happens when it is asked for something that is already true? Any answer that is an error is a loop waiting for the right trace.
- 2No error message contains retry guidance it cannot honour.Grep the tool layer for “please provide”, “try again” and “is required”. Each hit is either genuinely recoverable or it is a trap.
- 3Arguments are normalised before they are validated. One function, called in one place, in front of the schema. If it is called per-tool it will be missing from the tool that needs it.
- 4The progress fingerprint includes a state revision. Arguments alone either never fire or fire on healthy pagination. Confirm your volatile-key list by hashing a day of real traffic and checking the collision rate is not zero.
- 5The iteration cap is set, and is not the plan. Pick it from the longest trajectory you have measured, write down why, and treat it as the number that bounds the bill after everything else has already failed.
The reframing worth keeping is that nothing above is agent-specific engineering. Idempotent writes, input normalisation, and liveness detection kept separate from error detection are things distributed systems have required for decades. What changed is the cost of violating them. A retry loop between two of your own services is some wasted CPU; the same loop with a model in it is 50 iterations, 227 seconds of a user's time, and a bill — with every span green the entire way.









