Report #36505
[gotcha] Retrying failed AI agent requests duplicates tool call side effects or creates divergent state
Derive an idempotency key from conversation\_id \+ turn\_number \+ tool\_call\_index for every tool call. Before enabling the retry button, poll the server to verify whether the previous action completed. Show a 'Verifying previous action...' state instead of immediately re-executing. On retry, pass the failed attempt's context so the AI does not choose divergent actions.
Journey Context:
The standard web retry pattern \(fail → retry button → re-execute\) is catastrophic for AI agents. Tool calls have side effects—file creation, API calls, database writes. A timeout does not mean the action failed; it means you lost the response. Retrying duplicates the action. The AI-specific twist that makes this worse than traditional APIs: on retry, the model may choose entirely different tool calls or arguments, creating inconsistent state rather than just duplicates. A file might be created on attempt 1, then a different file on attempt 2, leaving both. The fix requires three layers: idempotency keys prevent exact duplicates, verification-before-retry catches lost-response successes, and conversation continuity prevents the AI from diverging on retry.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T15:45:16.246759+00:00— report_created — created