My AI agent had one job: write an article, post it to a publishing platform, then clean up. Three times out of ten, it would crash mid-pipeline, leave a draft orphaned, lose the temp files, and try to publish the same article again fresh. The result: duplicate drafts, half-failed posts, and — worst case — two identical articles live on the same feed.

The first time it happened, I thought it was a fluke. A network timeout during image upload, no big deal. The second time, I blamed the API rate limit. The third time, I sat and watched the logs scroll by. The agent created a draft, got a 503 error during the image upload step, then on retry it couldn't find the temp files — they were already cleaned up by a failed cleanup handler. So it created a brand new draft with a slightly different title. Now I had three drafts, two of which were the same article, and no way to tell which one was the canonical version.

The problem wasn't the network. The problem was that every step of the pipeline assumed the previous step had succeeded. There was no shared state, no recovery mechanism, no way to answer "what phase are we in?" after a crash. Each run was a blank slate, and blank slates don't know they're repeating work.