An agent that calls a tool twice with the same intent and gets two different side effects is not a reliability feature, it is a data corruption bug. In production agent fleets the most expensive incidents rarely come from model errors. They come from retries that succeed too well: a timeout fires, the orchestrator retries, and the downstream system has already committed the first attempt. The operation runs twice, the ledger records two entries, the customer receives two emails, and no alert fires because both attempts returned HTTP 200.

The retry storm mechanism

Retries are supposed to be a safety net. In agent workflows they become an amplifier because three layers retry independently. The model layer retries on a malformed response. The tool client retries on a socket timeout. The queue layer redelivers a message when the worker does not acknowledge in time. Each layer has its own backoff, its own deadline, and no knowledge of the others.

The result is a multiplicative fan-out. One user request that hits a transient timeout can produce six downstream calls to a payment API or a database writer. Backpressure then slows the fleet exactly when it is already loaded, which is the definition of a storm. Related reading on queue admission control: Queue Backpressure and Replay Safety for AI Agent Operations.

Why exactly-once delivery is the wrong goal

Distributed systems research is unambiguous on this point. Exactly-once message delivery is either impossible or prohibitively expensive across network partitions, and every practical broker document instead offers at-least-once delivery plus application-level deduplication. A survey of distributed message broker semantics covers the trade space in detail (DOI: 10.48550/arxiv.1704.00411). Research on backpressure and predictive scheduling shows that uncontrolled retries degrade throughput for every tenant sharing the queue, not just the one that generated them (DOI: 10.1109/tnet.2015.2460749).

The correct target is exactly-once effect, achieved through idempotent operation design. The delivery guarantee stays at-least-once. The side effect becomes safe to repeat.

Idempotency keys at the operation boundary

The fix lives at the operation boundary, not in the retry policy. Queue-side admission control and replay safety are covered in Queue Backpressure and Replay Safety for AI Agent Operations. Every state-changing agent action carries an idempotency key derived from deterministic inputs: the workflow run ID, the step index, and a hash of the operation payload. The receiving service records the key before executing and returns the stored result on a repeat.

Four properties make the pattern hold under real load:

  1. The key is computed by the caller before the first attempt, so a retry after a timeout reuses the same value.
  2. The deduplication record is written in the same transaction as the effect, so a crash between them cannot produce a phantom.
  3. The stored response is returned verbatim on a repeat, so the retrying layer sees a normal success and stops retrying.
  4. The key has a TTL aligned with the maximum retry window, so storage does not grow without bound.

Payment systems adopted this pattern for the same reason agent platforms now need it. A resilience study of retry and idempotency in payment processing documents the failure mode when the key is absent or computed after the first attempt (DOI: 10.56726/irjmets67696). A 2026 study reports the same class of bug in LLM agent tool calls, confirming the transfer (DOI: 10.52783/jisem.v11i2s.14608).

What to measure

Three metrics expose the problem before it becomes an incident. Duplicate effect rate counts committed side effects that share an idempotency key. Retry amplification factor is downstream calls divided by originating user requests. Second attempt success rate distinguishes a healthy transient retry path from a path that is silently double-charging.

A fleet with no idempotency keys cannot report the first metric at all. That absence is itself the finding. Related operational metrics are covered in Financial ROI Telemetry for AI Agent Deployments.

Data Foundation and Journals

  • DOI: 10.52783/jisem.v11i2s.14608
  • DOI: 10.56726/irjmets67696
  • DOI: 10.48550/arxiv.1704.00411
  • DOI: 10.1109/tnet.2015.2460749