Handling Step Failures

retries, and required vs. optional steps

Part of: Multi-Step Task Agent

Tools fail. A search times out, a calculation gets fed garbage, a file write hits a permissions error. A throwaway script crashes on the first failure and calls it a day. A production agent has to decide, per step, whether a given failure kills the whole plan or barely matters. Retry before giving up Most tool failures are transient, a flaky network, a momentary rate limit, so the first line of defense is simply trying again a couple of times before treating it as a real failure: Notice the branch at the end: exhausting retries doesn't always mean the same thing. Required steps vs. optional steps Mark each step in the plan as required or optional . "Calculate the total" is required: everything downstream needs that number, so if it fails after every retry, the plan stops and reports failure. Limping forward with a missing number would hand back a confidently wrong answer. "Post a summary to Slack" is optional: nothing later depends on it, so if it fails, the agent logs the failure, skips the step, and keeps going. The plan can still finish successfully. That one flag on each step is what keeps a single flaky tool call from sinking an entire multi-step task, without quietly papering

Challenge: Run the Plan With Retries