C.W.K.
Stream
Lesson 04 of 05 · published

Failure Handling and Replanning

~28 min · failure, replanning

Level 0Observer
0 XP0/40 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

Failure is information

Tool failures, missing files, bad assumptions, and contradictory evidence are not interruptions to the plan. They are observations that may require a new plan.

A replanning agent records what failed, why it failed, whether it is retryable, and what alternative path is available.

Retry is not a personality trait

Retry transient failures with backoff. Do not retry deterministic failures without changing something. If a schema validation fails, fix the payload before trying again.

Repeated blind retries are how agents become expensive clocks. Tick, bill, tick, bill. Very elegant.

Code

Failure record·json
{"step":"run tests","error_type":"deterministic","error":"ModuleNotFoundError: app","retryable":false,"change_required":"set PYTHONPATH or run from repo root","next_plan":["inspect test command","rerun with correct cwd"]}

External links

Exercise

Write a failure record for a tool call that timed out and one for a schema validation error. Mark retryability.
Hint
Timeout and schema error usually have different recovery paths.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.