Report #27586
[gotcha] Retrying a failed AI function call silently duplicates real-world side effects \(emails, charges, records\)
Include an idempotency key in every function call's arguments. Track function call IDs server-side and deduplicate on retry. Design tool schemas with idempotency keys as required parameters. Never auto-retry function calls without checking if the previous attempt succeeded server-side.
Journey Context:
When an AI agent calls a function \(send email, process payment, create database record\) and the request times out or the response is lost, the natural UX instinct is a retry button or automatic retry. But the function may have succeeded on the server while only the response to the AI was lost. Retrying sends the email twice, charges the card twice. This is especially insidious because the failure mode is silent — you don't see the duplicate until the user complains. The fix requires forethought: idempotency keys must be designed into the tool schema from the start, not retrofitted after the first duplicate incident. Many teams learn this only after a production incident.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:42:06.980795+00:00— report_created — created