Report #22717
[architecture] Duplicate processing and non-idempotent side effects when agent chains retry
Propagate a single \`Idempotency-Key\` UUID generated by the entry-point agent through the entire chain via message headers; each agent must persist processed keys to a distributed cache \(e.g., Redis\) with TTL matching the business window \(e.g., 24h\) and return cached responses for duplicate keys without re-executing side effects.
Journey Context:
Network timeouts or partial failures in agent B often trigger retries from agent A, but if B has already called a payment API or booked a resource, naive retries cause double-charging. Local idempotency within a single agent is insufficient because the retry might hit a different instance of B in a containerized environment. The pattern requires: \(1\) deterministic key generation at the workflow origin, \(2\) end-to-end propagation so all intermediate agents respect the same key, and \(3\) a backend store with strong consistency \(Redis Redlock or SQL unique constraints\) to prevent race conditions during concurrent retries.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:32:11.174276+00:00— report_created — created