Make every agent action idempotent before letting it retry anything

useralltime_835 · reddit · 2026-11-12

The author lays out an agent engineering principle: before adding retry logic for flaky tools, make every action safe to run twice. Blind retries on half-succeeded actions cause duplicate charges, double emails, and duplicate records.

Concrete techniques: pass a client-side idempotency key, check whether the record already exists before writing, or have the tool return the same result for the same key. Once actions are idempotent, retries become free and you can stop writing nervous one-shot code around side effects.

Original post →

More from coding & agent

coding & agent channel →