Strip away the frameworks and most agents run the same loop. The model produces a short piece of reasoning about what it should do, emits a tool call, receives the result, and reasons about that result before deciding the next step.
That interleaving — reasoning and acting alternating rather than one long plan followed by execution — is the pattern. It works because the model gets to revise its approach based on what it actually observed, rather than committing to a plan built on assumptions.
What changed in 2026
- The pattern became implicit rather than prompted. Models trained for tool use exhibit it natively, so the explicit thought-action-observation scaffolding in prompts became largely unnecessary.
- Context management became the limiting factor. As loops got longer, accumulated observations rather than reasoning quality became the constraint.
- Convergence controls became standard. Step caps, budgets, and progress detection moved from good practice to requirements.
- Structured tool calling replaced text parsing. Native tool-call formats removed a whole class of parsing failure the original pattern suffered from.
The loop, and where the cost lives
Each iteration adds three things to the conversation: the model's reasoning, the tool call, and the tool's result. All three stay in context for every subsequent turn.
The observations are the expensive part. A tool returning a large file, a long search result, or verbose API output puts all of it into the window, permanently, and the model re-reads it on every remaining turn.
| Iteration |
Context contains |
| 1 |
Prompt, reasoning, call, result |
| 5 |
Everything from iterations 1–4, plus this one |
| 20 |
Twenty rounds of accumulated tool output |
Which is why a twenty-step agent run is far more expensive than twenty single calls, and why prefix caching matters so much — each turn's prefix is the previous turn, so almost everything is cacheable.
It is also why context compaction and clearing stale tool results become necessary rather than optional past a certain loop length.
How it fails
Non-convergence. The model repeats an action, gets the same result, and tries again. Nothing errors; it simply never decides it is finished. This is the single most common agent failure and the reason step caps and token budgets are mandatory rather than advisable.
Reasoning that is not verification. The model states "I have now confirmed the value is 42" in text that reads like a check and was produced by the same process that produced the value. Reasoning text is a plan, not evidence — treating it as validation is how confidently wrong conclusions survive.
Context poisoning. A wrong observation early — a stale document, a tool returning a cached value — propagates through every subsequent step, and the agent grows more confident as it accumulates reasoning built on it. See context poisoning.
Tool errors handled badly. A failed call returning an unhelpful message leaves the model guessing. Error text is part of your prompt surface and deserves the same care as tool descriptions — see agent tool error handling.
When a workflow is better
The pattern's value is handling tasks you could not enumerate in advance. If you can enumerate them, you should.
A task with a known fixed sequence — extract, validate, transform, store — is a workflow. Writing it as deterministic control flow with model calls at the steps that need judgement is cheaper, faster, more predictable, and far easier to debug than letting a model rediscover the sequence each time.
The honest test: could you write the steps down? If yes, write them down. Reserve the agent loop for genuine exploration.
Common mistakes
- No step cap. Non-convergence becomes an unbounded bill.
- Treating reasoning as verification. Same process, no independent check.
- Letting observations accumulate unmanaged. Context fills with stale tool output.
- Using it for a known sequence. A workflow is better in every respect.
- Unhelpful tool error messages. The model cannot recover from what it cannot understand.
- No tracing. A twenty-step failure is undiagnosable without per-step spans.
FAQ
Do I need to prompt the pattern explicitly?
Rarely on current models — tool-use training makes it native. Explicit thought-action-observation scaffolding is mostly legacy and consumes context.
How many steps is reasonable?
Task-dependent, and the useful discipline is measuring your own distribution and capping above the legitimate tail. Most tasks converge in far fewer steps than the cap you would set.
How does this differ from tree search?
ReAct commits to one path and revises as it goes. Tree search explores alternatives and backtracks. Search is more thorough and much more expensive — see tree search agents.
What about reflection?
Adding an explicit critique step is a common extension that helps on some tasks and adds cost on all of them — see agent reflection loops.
Where to go next
For bounding the loop, read agent token budgets and agent timeouts. For the tracing that makes failures diagnosable, AI agent observability.