Answer
How should an agent decide what to do next?
From the gap between observed state and the finished condition, checked against a plan it wrote down rather than remembers.
By comparing what it has observed against the stated finished condition and taking the step that closes most of the gap. Without a stated condition there is nothing to compare against, and the next step becomes whatever seems reasonable.
The loop's quality depends almost entirely on what the next-step decision is made against. Given an observable finished condition, the decision is a comparison: here is the state, here is the target, this closes the largest part of the difference. Given no such condition, the decision is made against a sense of what a competent worker would do next, which produces plausible activity that drifts, because each step is reasonable relative to the previous one rather than to the goal.
That is the argument for the plan being written rather than held. A plan present in the session is subject to the same recency effects as everything else: the recent steps carry more weight than the original decomposition, so by step forty the agent is following a plan that has quietly evolved. A plan in a file is re-read rather than recalled, and re-reading is what keeps the comparison against the original rather than against the drift.
The second input is observed state rather than assumed state. An agent that decides its next step from what it believes it accomplished is reasoning from a record of intentions, and where an action failed silently the whole subsequent sequence is built on a false position. Reading back the actual state before choosing the next step is one call and it converts the loop from open to closed.
The third is the failed attempt. A next-step decision that does not account for what has already been tried produces the retry loop: the same approach chosen again because it still looks like the right approach. Keeping the abandoned routes in the working record, with why each failed, is what makes the next choice different from the last one rather than a repetition of it.
There is a prioritisation question that arises when several steps would all close part of the gap, and the useful ordering is by what would invalidate the most work if wrong. Establishing a fact that everything depends on before building on it is cheaper than discovering it later, and this ordering is not the same as doing the easiest thing first or the most valuable thing first. It is the one that minimises rework.
Finally, the decision should include stopping as an available option at every step. A loop whose only choices are actions will find an action, and the choice not to continue has to be explicitly permitted for it to be taken. Making the finished condition checkable and the stop reportable is what turns the next-step decision into one that can terminate.
Without a finished condition there is no gap to close, so the next step is chosen by what looks like progress.
Siddharth Sharma, Context Theory
Related questions
Should the agent replan as it goes?
It should update the written plan when it learns something that invalidates it, and the update should be visible rather than implicit. Silent replanning is drift; recorded replanning is a decision somebody can review. The distinction is whether the change to the plan is written down alongside why.
What if several steps look equally good?
Then order by what would cause the most rework if wrong, and if that does not separate them, the choice genuinely does not matter and picking either is correct. Time spent deliberating between equivalent steps is a cost with no return, and an agent that reports the tie rather than agonising over it is behaving well.
METHOD
Every figure below carries its source and the date it was verified. Nothing on this page is asserted.
The numbers on this page.
| What | Value | Specific to |
|---|---|---|
| Sub-15-minute compliance — automated routing vs manual only | 62.5% vs 39.1% | Category-wide |
| Close rate — response under 5 minutes vs over 24 hours | 32% vs 12% | Category-wide |
2026 speed-to-lead benchmark · verified
Optifai speed-to-lead benchmark · n=939 companies · Q2 2025–Q1 2026 · verified
What is specific to this page.
| Kind | Claim | Check it against |
|---|---|---|
| Workflow | With an observable finished condition the next-step decision is a comparison against a target, and without one it is made against a sense of what comes next, which produces steps reasonable relative to the previous step rather than to the goal. | Comparing the step sequences of runs with and without a stated observable completion condition. |
| Software | A plan held in the session drifts under recency effects while a plan in a file is re-read rather than recalled, which is what preserves comparison against the original decomposition. | Asking an agent deep into a run to state its plan and comparing with the written one. |
| Response | Choosing the next step from believed rather than observed state builds the subsequent sequence on a false position wherever an action failed silently, which a state read-back before each decision prevents. | Introducing a silently failing action and observing whether subsequent steps assume it succeeded. |
| Constraint | Ordering candidate steps by what would invalidate the most work if wrong minimises rework, and this differs from ordering by ease or by value. | Identifying which steps in a plan other steps depend on, and comparing against the order chosen. |
Each row would be wrong on another industry's page. Where a sourced figure exists it is in the table above instead; these are the constraints that shape the work and do not happen to be numbers.
Start with the measurement.
Reading about a benchmark is not the same as knowing your own number. The audit produces yours, measured rather than estimated.
$497 · delivered in 5 business days · credited against month one