Report #42644
[gotcha] Retry on failed AI agent actions silently duplicates side effects
Assign an idempotency key to each AI agent invocation and propagate it through all side-effecting tool calls. On retry, reuse the same idempotency key so downstream systems can deduplicate. Before offering retry, query partial completion state and show the user what already succeeded: '3 of 5 files were created. Retry the remaining 2?' Design your agent's tool interface to accept and respect idempotency keys.
Journey Context:
The standard retry pattern \(show error, offer retry button\) works for read-only or atomic operations. But AI agents perform multi-step workflows with side effects: creating files, sending messages, making API calls, writing database records. When step 3 of 5 fails and the user hits retry, steps 1-2 execute again, creating duplicates. This is especially dangerous because AI agents typically don't have transaction semantics across their tool calls — each tool invocation is independent. The problem is invisible until you discover duplicate data in production. The fix requires treating AI actions as sagas rather than atomic transactions. Each step must be idempotent, and the retry UX must be aware of partial completion state. This is an architectural decision that must be made before building the agent, not after discovering duplicate data.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T02:02:46.429690+00:00— report_created — created