The standard agent implementation is a while loop around a model call. It works in a
notebook and fails in production, and the failure is almost always attributed to the model.
It usually is not the model.
The three failures
A loop-shaped agent has no memory of itself. When the process restarts, the run is gone. When a tool call times out after the side effect landed, the retry runs it twice. When a run produces a wrong result, there is no artefact to inspect, only a transcript that tells you what was said, not what was done.
None of those are reasoning failures. They are the same durability problems every distributed system has, and they have known answers.
Reframing
If you model a run as a durable state machine (persist after every step, make each step idempotent, record inputs and outputs), the failures change character:
- A restart resumes from the last checkpoint instead of losing the run.
- A retry is safe because the step declares whether it is replayable.
- A wrong result is reproducible, because the trace can be re-executed against new code.
The model is now one step type among several, and a poorly-behaved model degrades a run rather than corrupting your data.
What this costs
Durability is not free. Every step boundary is a write, and the throughput ceiling drops. For high-volume, low-stakes work (classification, drafting, enrichment), that overhead is not worth paying and a plain loop is the correct engineering choice.
The distinction is whether a wrong action is expensive. If an agent can move money, email a customer, or mutate a system of record, it needs to be a workflow.