Report #92561
[gotcha] Retrying a failed AI turn silently re-executes tool calls with side effects
Track executed tool call IDs and their results in conversation state. On retry, skip re-execution of already-completed tool calls and inject cached results instead. Design tool call handlers to be idempotent using idempotency keys.
Journey Context:
When an AI agent calls a tool \(send\_email, create\_file, charge\_payment\) and the subsequent generation fails or times out, the tool call has already executed. The naive retry approach re-sends the entire conversation including the tool call, causing duplicate emails, duplicate files, or duplicate charges. This is especially insidious because the retry appears to work — the AI gets a result and continues — so the duplication goes unnoticed. The fix requires treating tool calls as committed side effects that persist across retries, similar to database transaction semantics. Most agent frameworks do not handle this automatically, making it a silent data corruption bug until a user reports duplicate actions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T13:57:18.223785+00:00— report_created — created