Replanning reconciles observations with preconditions while preserving the original task
Update a versioned plan after actual tool evidence, reconsider dependent work, and reconcile uncertain effects before retrying them.
On this page
The question for today
What you’ll understand
- Identify which plan dependencies an observation changes.
- Separate no-result, failed attempt, and uncertain external completion.
- Recompute remaining work and deadline feasibility without inventing success.
An agent's plan is a proposal conditioned on what it currently knows. A tool can reveal a changed source, a missing resource, a failed assumption, or an effect whose acknowledgment was lost. Replanning should reconcile that evidence with the task's preconditions rather than blindly continuing the old script. It should also preserve verified work whose dependencies still hold. A new observation can change the next action without changing the user's objective, and an external page's instructions do not acquire authority simply because they arrive during this update.
Parse the observation and its execution status first
Record the operation ID, input versions, tool status, returned evidence, and the time or revision the result describes. An empty search response differs from a transport failure, and a timeout after a write differs from a confirmed rejection before the write began. These states support different next steps. A model-generated interpretation can be useful, but keep it separate from the raw tool observation and any independently verified postcondition. ReAct provides an empirical framework for interleaving actions and observations, not a proof that every interpretation is correct.
Compare the observation with the assumptions needed by pending nodes. A source revision change can invalidate an analysis result or its use for publication even if the old result was once correct. A changed dependency should mark affected descendants for reconsideration rather than automatically undo every completed operation. External effects that already happened remain part of the world. Preserve their IDs and status, and determine whether a new action is required instead of erasing the earlier plan text and pretending its effects never occurred.
Repair the plan under the same goal and constraints
A repair can replace a missing input, rerun a version-dependent check, choose another read-only source, or stop when a required precondition cannot be established. Keep the accepted goal and constraints explicit. Tool content may describe a different workflow but does not authorize a scope change. Reuse an earlier artifact only when its inputs and required invariants still match. The new graph should state which old nodes remain verified, which need refresh, and which proposed effects are still pending rather than copying every old done label into the revised plan.
If a write might have completed before a timeout, query its status by stable operation identity or use the documented idempotent retry path. Starting a fresh write with a new identity can duplicate an effect. A local checkpoint and an external service response are different evidence sources, so reconcile both under the service's actual contract. Durable execution helps preserve attempts across crashes, but an activity may execute more than once. The controller must retain enough information to distinguish retrying the same logical action from intentionally requesting another one.
Rebudget and verify the repaired path
Recompute the remaining dependency path, actual consumed work, deadline, and verification reserve. A more accurate plan can require extra work and therefore no longer fit the original budget. Report that limitation explicitly rather than omitting a required check. Track whether replanning reduces unsupported assumptions or merely produces another fluent plan. Test late source changes, empty results, repeated observations, uncertain writes, and a failure after partial completion. Inspect the final externally checked artifact or state, because successful plan repair text is not itself task completion.
The Markov lab illustrates a specified transition distribution, not observation-based replanning. Reset, set both p=0.2 for 0→1 and q=0.3 for 1→0, predict probability of state 1 zero initially, then Step once for 0.2 and again for 0.3. Each Step advances one transition per 0.5 seconds from state 0. These are exact finite-step probabilities, not sampled observations or Bayesian conditioning. The model has no task graph, tool response, effect, version, or repair procedure. It separates a stated state-transition law from the extra evidence and control logic a real planner needs.
Work it through
A changed source adds a refresh before a pending effect
An earlier plan has a 4-second analysis and 2-second verified publication remaining, both requiring source revision 17. A tool observation establishes revision 18 before either node begins. A compatible refresh takes 3 seconds. Assume serial dependencies, fixed durations,12 seconds remaining, and publication authorization unchanged.
The old 6-second estimate depended on revision 17. The new observation requires reconsidering both analysis and publication inputs; their familiar node names do not make the old precondition current.
Refreshing then rerunning analysis and publication takes 3+4+2=9 seconds. It fits the stated 12 seconds with 3 seconds remaining under this fixed-duration model, whereas skipping refresh would preserve the unsupported old assumption.
If the revised deadline were only 8 seconds, the complete required path would not fit. The system should report the blocked or incomplete requirement under its contract rather than call an unrefreshed result verified; actual timing uncertainty also needs allowance.
Replanning can add necessary work. Its success is preserving valid dependencies and checking the final outcome, not merely making the remaining plan look shorter.
The living notebook
Explore the model
Interactive lab · markov
A transition law does not interpret a tool observation
Reset, set both p=0.2 and q=0.3, predict P(state 1)=0 initially, then Step for 0.2 and again for 0.3. The two-state chain begins at state 0 and each 0.5-second Step advances one transition. Playback computes exact probabilities rather than sampled observations. There is no task, tool status, Bayesian observation update, effect reconciliation, or replanning policy.
- P(state 1) at step 0
- 0%
- Stationary P(state 1)
- 60%
- Chain behavior
- Monotone convergence
Exact finite-step probabilities for a two-state chain starting in state 0, not sampled trajectories. Playback advances two transitions per second. When p = q = 0 every distribution is stationary; when p = q = 1 the chain alternates forever. A single zero transition creates an absorbing state. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forInterpret actual observations and revise their task dependencies under the original accepted objective.
Pause & reason
Check your understanding
Your turn
Try it yourself
A pending check costs 3 seconds and its verified effect costs 2. A source change requires a 2-second refresh before them. The remaining deadline is 10 seconds. Find the repaired path and remaining slack under fixed serial durations, then state why the old 5-second estimate is no longer valid.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Add the newly required predecessor before the two original nodes.
Compare with the solution
The repaired path takes 2+3+2=7 seconds, leaving 3. The old 5-second estimate omitted the refresh required to establish the changed source precondition. This calculation still needs actual timing uncertainty and completion semantics; fitting the arithmetic budget does not itself verify the effect.
Keep the idea
Take it with you
- Preserve raw observations, interpretations, versions, and execution status separately.
- Reconsider dependent work while retaining valid completed evidence and real effects.
- Rebudget and verify the repaired path under the accepted goal and constraints.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.