Handling Failed Steps
Not every step in a plan will succeed. A well-designed planner has a strategy for each type of failure: retry, fallback, skip, or escalate.
Failure Response Strategy
Transient failure (network error, timeout):
→ Retry with exponential backoff (1s, 2s, 4s)
→ After 3 retries, use fallback
→ After fallback fails, escalate
Client failure (bad arguments, invalid input):
→ Do NOT retry — fix the arguments first
→ Replan with corrected parameters or escalate
Not found (resource does not exist):
→ Try a broader search or alternative data source
→ If still not found, skip the step if optional or escalate if required
Permission failure (not authorised):
→ Escalate immediately — do not retry
→ Log the attempt and alert an administrator
Step limit reached:
→ Stop the plan immediately
→ Return a partial result with what has been accomplished
→ Escalate to a human for the remaining work