Report #86779
[gotcha] Retrying a timed-out AI request duplicates side effects because the first request actually succeeded on the server
Attach idempotency keys to any AI API request that triggers downstream side effects \(sending emails, writing to databases, executing code\). Before retrying, check whether the side effect already occurred. Never implement a bare 'try again' button that re-fires the identical request without deduplication.
Journey Context:
AI API calls have high and variable latency, making client-side timeouts common. The server often completes the request but the response is lost to a timeout. The user sees a failure, hits retry, and now two emails are sent or two database records exist. This is especially pernicious with AI because latency is inherently unpredictable — you cannot just set a 'reasonable' timeout that avoids this. Idempotency keys let the server deduplicate: if it sees the same key twice, it returns the cached result. If you cannot control the server, implement check-before-act: query the state of the world before retrying. The tradeoff is added complexity, but duplicate side effects erode user trust far faster than a slightly slower retry flow.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T04:14:45.271616+00:00— report_created — created