In Your AI Agent Retried the Tool Call. The First One Had Already Succeeded., Rudratosh Shastri uses a hypothetical invoice payment to explain why a tool timeout needs its own execution state. The payment provider may have committed the charge before the reply disappeared. If the agent treats the missing reply as a failed payment and opens a fresh operation, the customer can be charged again.
Give each approved operation a durable identity
Shastri separates the identifier for a model's tool invocation from the identifier for the business operation it requests. A second invocation can refer to the same approved payment. The application allocates the operation ID before calling the provider and keeps it across model retries, worker restarts, and queue redelivery. This gives each layer a common way to look up the original attempt.
A request fingerprint serves a different purpose. It can catch a retry that reuses an existing operation ID while changing the amount or another meaningful field. Two identical requests can still represent separate purchases made on purpose, so matching the payload alone is insufficient to establish that both requests come from the same decision.
Preserve uncertainty across a restart
The proposed coordinator records execution state durably and uses atomic claims to keep concurrent workers from starting the same operation independently. The harder case arrives after a worker has sent the request. A process can lose the reply or crash before saving it, leaving the ledger without a confirmed outcome. Shastri assigns that case an unknown state so a later worker can reconcile it with the provider.
If the provider supports idempotent requests, a repeat attempt can reuse the original key within the provider's documented limits. Where the provider supplies a reliable lookup, the coordinator can use it to recover the outcome. When neither path can establish what happened, Shastri leaves the case for reconciliation or human investigation.
One test follows directly from the payment example. Let the provider commit one operation, suppress the response, and redeliver the job to exercise the recovery path. The observable result to check is the number of external effects and the final ledger state after the retry.