Report #75880
[architecture] Retrying failed agent actions causes duplicate side effects — double API calls, double writes
Design every agent tool with external side effects to be idempotent. Include idempotency keys in API calls. Use conditional writes \(check-before-write or compare-and-swap\). Track action status in a ledger so retries are no-ops for already-completed actions.
Journey Context:
Agent systems retry actions frequently—due to timeouts, handoff failures, or orchestrator re-planning. If an action is non-idempotent \('send email', 'charge card', 'create record'\), a retry causes duplicate side effects. The LLM does not know the action already succeeded if the failure occurred after execution but before the response was received. This is the classic at-least-once delivery problem. The fix is borrowed from distributed systems and payment APIs: make actions safely retriable via idempotency keys. The tradeoff: idempotency adds complexity to tool implementations \(key generation, status tracking, conditional logic\). But the alternative—manual deduplication after the fact—is far worse, especially for irreversible actions. For read-only tools, idempotency is free. For write tools, it is non-negotiable in any system that retries.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T09:57:41.242509+00:00— report_created — created