The agent timed out. Should you retry?
A timeout does not tell you whether the action happened.
If an agent retries a refund after a timeout, it may issue a second one. Workflows need an honest state for this case. I call it outcome unknown.
Three situations look like one error
A timed-out request may never have reached the service. It may have completed with the reply lost. It may still be processing. A generic retry treats all three the same. The right question is: what evidence would justify the next step?
Keep the identity of the operation
Create an operation identifier before the first submission and keep it through recovery. Where a service supports idempotency, follow that service's documented rules on key scope, retention, parameter matching and concurrency — a key stored only in the agent's notes cannot prevent duplicate effects on the other side. The Amazon Builders' Library and Stripe's API reference are good starting points; read each provider's contract directly.
Reconcile before deciding what comes next
- Confirmed completion — record the result; do not start a replacement action.
- Retryable failure — follow the service's retry rules under the same operation identity.
- Still uncertain — keep it uncertain, then reconcile or escalate.
An empty lookup is not proof of failure: the original request may arrive later, or the lookup may be stale. Approval is a separate check — a technically safe retry can still be wrong if the amount, destination or authority has changed.
A small example you can run
A Python example with a fake service that records an effect and then times out. The reconciliation path finds the completed operation; if readback is unavailable, it preserves the unknown outcome. Six local tests cover lost replies, same-key retries, new keys, changed parameters, unavailable readback and missing records. It is a sequential teaching model without durable storage, concurrency enforcement or real-service recovery.
Code and test output on GitHub
Give recovery a decision boundary
Recovery should be an explicit, evidence-based decision. Record the request, its operation identity, what the service acknowledged, the observed state, and what remains unresolved. A retry needs a stronger reason than a task that still says "in progress." When reviewing an agent integration, ask whether the system can identify the original operation and explain why its next action will not cause a second effect.