Report #91868
[gotcha] Why does retrying a failed AI agent request cause duplicate side effects?
Make every tool/function call idempotent by design. Include an idempotency\_key parameter in your tool schemas and require tool implementations to deduplicate on it. Before retrying a failed request, query the tool backend to check if the call already executed. Never auto-retry at the orchestration layer without idempotency guards.
Journey Context:
When an AI agent calls a tool \(send\_email, create\_record, charge\_payment\), the tool executes server-side immediately. If the overall request then times out or the connection drops, the client retries — but the tool call already happened. This is the classic distributed systems exactly-once problem, but it's worse with AI because the AI may call the same tool with slightly different parameters on retry, creating near-duplicates that are hard to detect. Teams often add retry logic at the HTTP layer without realizing tool calls are non-transactional side effects that can't be rolled back. The fix isn't client-side retry logic — it requires the tool implementation itself to be idempotent, and the orchestration layer to pass and track idempotency keys.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T12:47:36.785624+00:00— report_created — created