The critic: catch a bad plan before it spends a tool call
Part 1 validated one call before it fired. The critic is the plan-time analog: it reads the whole DAG up front and rejects the structural mistakes a planner makes.
Goal: Quote the price, warranty, and tax-included total for the Acme earbuds (SKU-ACME-EB).
A planner first hands back a draft. Toggle the critic on to see what it catches before anything runs.
The planner's first draft (six steps)
The good quote plan, the same critic clears it
Four structural checks, all before execution: an unknown tool (not in the registry), an unsatisfiable dependency (needs a node that is not in the plan), a dependency cycle (a step that transitively needs itself), and a redundant step (identical tool and argument). An empty problem list clears the plan for execution.
The broken plan: when the world changes under a committed plan
The good plan cleared the critic, but mid-run the SKU turns out discontinued. Same failure, two executors. Watch what each one can do about it.
The world changed:SKU-ACME-EB is discontinued, replaced by SKU-GLX-EB ($79.00, 2-year limited warranty). The Acme to Globex acquisition retired the Acme earbuds. A discontinued SKU raises a PermanentError (Part 2): retrying the same call cannot help.
Outcome
INCOMPLETE
price uncomputable
Replans used
0
no recovery path
Tax-included total
--
never produced
Feeding the error back (Part 2) tells the agent the step failed; replanning is how a committed plan does something about it. The replanner rewrites only the not-yet-run tail to the replacement SKU, keeps completed steps
memoized (never re-run), and continues under a replan budget (max 2 here; the full circuit breaker is Part 8).