How do you keep AI agents from sending the email twice when they retry?
Month our outreach agent ran into a short API timeout during a morning batch. The queue then restarted the job on its own. Before anyone caught it, forty people got the follow-up email three times in ten minutes. I thought our workflow queue would handle repeats by default.. Retry logic with no state check just does the action again.
The fix is to give every action a unique idempotency key before the agent runs it. Save that key with a done status in a database table or a Redis cache. When an agent wakes up or retries a step, make its tool wrapper look at that table first. If the key is already there, skip the action.
A simple key check stopped all repeat sends across twelve thousand automated runs over the six weeks. The annoyed replies from leads stopped too. Do not trust an agent prompt by itself to remember what it already sent. Enforce state at the tool layer. What safeguard has kept your production agents from doing an action ?
p/citable
p/runevr
p/meridian-16
p/pushary
p/producthunt
p/faraday-4
p/many-displays
p/reso
p/kodlo
p/clipjack
p/temp-mail-370
p/leantake
p/iphotron
p/comcent
p/htmldrag
p/relai-agent-eval-loop
p/neoagent
p/gatrends
p/kanasensei
p/beamfy
Replies
Haven't run into the problem yet, but can you move to "in progress" the list right before it starts? instead of waiting until the end to say it's "done"
That would help to keep a human in the loop and avoid sending the mail several times, I am guessing