Long-horizon agents don't crash — they lose the plot
A long-running agent almost never dies. There is no stack trace, no failed health check, no moment you can point to. Every individual step returns success — and forty steps in, the work is quietly unrecognisable. The characteristic failure of long-horizon agents is not a crash but a collapse of coherence: the goal drifts, small errors compound, and the agent's own past mistakes become the context it reasons from. No retry logic can catch this, because retry logic watches for steps that fail, and here every step "succeeds."
Two mechanisms make this the default outcome rather than bad luck. The first is arithmetic. If an agent completes each step with probability p, the horizon it can sustain at a given success rate scales as log(s)/log(p) — which means errors compound geometrically with task length, and conversely that small per-step accuracy gains buy exponentially longer reliable horizons. This is the "illusion of diminishing returns": a model that looks barely better on short benchmarks can be dramatically better at long tasks. METR's measurements point the same direction — the task horizon frontier models sustain at 50% success has been doubling roughly every seven months.
The second mechanism is nastier: the self-conditioning effect. Sinha, Sethi, and Allen-Zhu showed that a model's per-step error rate rises once its own errors enter the context. The error-injection counterfactual is elegant — give one run a "healed" history with mistakes edited out, give another the true error-laden history, and the healed run performs measurably better on identical remaining work. The agent isn't just accumulating errors; it's learning, within the session, to be the kind of agent that makes them. Add goal drift — tangential sub-tasks gradually displacing the original objective — and you get the trajectory every operator of long-running agents recognises: locally reasonable, globally lost.
What actually helps
Since no single step fails, the defences have to operate at the trajectory level. Three layers, in the order I'd add them.
Budgets bound the damage. Step budgets, token budgets with a continue/stop decision around the 90% threshold, wall-clock timeouts, cost limits. A budget won't detect that the agent has lost the plot, but it converts unbounded coherence collapse into a bounded, inspectable artefact. Every long-horizon agent needs a hard answer to "when does this stop no matter what?"
Drift detection notices the slope. Establish a behavioural baseline, then watch for the slow signals: embedding drift in outputs, rising tool-call repetition, CUSUM-style detection of small persistent shifts that no single-observation alert would fire on. The drift-budget framing is useful here: expected accumulated error is bounded by the number of turns times the per-step error rate, which is why empirical session lifetimes tend to land in the 50–200 turn range before a reset pays for itself.
Re-grounding checkpoints reverse the mechanism. If self-conditioning is the disease, the cure is deliberately curating what the agent sees of its own history: sliding-window context engineering that removes the agent's errors from context, periodic re-statement of the original goal against current state, and checkpoints where a human or a verifier re-anchors the trajectory before it continues. Compaction here is not a memory optimisation — it's a choice of loss function, and "drop my own mistakes" is a defensible one.
The honest counter-case: collapse is not a law of nature. RL-trained thinking models hold per-step accuracy essentially flat out to a hundred turns in the same experiments, and sequential test-time compute beats parallel voting for exactly this reason — so better models genuinely push the cliff out. But "further away" is not "gone." The compounding arithmetic still applies past whatever horizon the model can natively sustain, and benchmarks like Vending-Bench keep showing frontier agents losing long-term coherence on mundane tasks. Design for the collapse you'll eventually hit, not the one the demo avoided.