Errors & recovery · 2026-09-25

A payment tool times out.

Your retry logic fires - and the customer is charged twice.

  1. AIncrease the timeout so the call has time to finish
  2. BStop retrying timeouts - they are not safe to repeat
  3. CAsk the user to confirm before every retry and show them the last charge, so a human always decides whether to pay a second time
  4. DSend an idempotency key, so the retry IS the same operation rather than a second one

Answer: D

Send an idempotency key, so the retry IS the same operation rather than a second one

Why

A timeout tells you nothing about whether the work happened. Only the receiver can settle that - an idempotency key lets it recognise the repeat. Longer timeouts and no-retry both just shift the failure.

More on this topic

More on Way of the Agent

Real situations from building agents - with the answer and why.

Solve a new one every day on the Path