Planning & Control Flow

Replan on Failure

Trigger a fresh planning step when execution evidence contradicts the current plan.

Problem

Plans are made under incomplete information, so some plans are wrong from the start and others become wrong partway through. Without a replanning step the executor will either keep trying the same broken sequence until the step budget runs out, or it will silently fail and return partial results that look complete. A naive replan-on-every-error policy thrashes — the agent re-plans, fails, re-plans again on the new plan, and never makes progress. The team needs explicit triggers that decide when failure is bad enough to send control back to the planner with the failure context attached.

Solution

Define replan triggers (tool error, unexpected observation, observer dissent). When triggered, the executor pauses and the planner runs again with the failure context. The new plan replaces the old one; partial progress is preserved if compatible.

When to use

  • Plans are made under incomplete information and execution evidence may contradict them.
  • Clear replan triggers exist (tool error, unexpected observation, observer dissent).
  • Partial progress can be preserved when compatible with the new plan.

Open the full interactive page

Diagram, neighbourhood map, code examples, related patterns and full provenance.

Related