All Questions
Agents And Tool Use medium

An agent's `issue_refund` tool calls a payment service that sometimes takes over 30 seconds. The agent loop treats the timeout as a failure and retries, and several customers have now been refunded twice. What is the correct fix?

  1. A Generate an idempotency key per logical action, persist it with the step, and have the refund service deduplicate on it.
  2. B Disable automatic retries for all tools in the loop and ask the model to decide whether the previous attempt succeeded.
  3. C Raise the tool timeout so that slow refund calls finish before the agent loop considers the step failed and retries.
  4. D Instruct the model in the system prompt to check conversation history and never call issue_refund twice for the same order.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions