All Questions
Agents And Tool Use hard

A customer-support agent calls a `create_refund` tool. The payment API times out after 30 seconds. The host retries the HTTP request, and separately the model, seeing an error, emits a fresh `create_refund` call on its next step. Some customers are refunded two or three times. Which fix closes both duplicate paths?

  1. A Pass the model-generated tool_call_id to the payment API as the idempotency key, since it uniquely identifies each requested action.
  2. B Add a system-prompt rule telling the model to inspect the transcript and never re-issue a refund that might already have succeeded.
  3. C Have the host derive the key from business intent (task, order, action) so both host retries and model re-emissions dedupe.
  4. D Disable automatic retries for side-effecting tools and return the timeout to the model as a hard failure it must reason about.

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

Get the app

Related questions