Report #76622
[architecture] Retrying or looping an agent causes duplicate side effects because tool execution state is not tied to the execution trace
Assign a globally unique idempotency key \(e.g., workflow\_run\_id \+ step\_id\) to every tool call invocation, passing it through the agent context, and enforce idempotency on the tool/API receiving side.
Journey Context:
Agents often fail mid-turn or require retries due to LLM API timeouts. If an agent calls a tool and times out, a retry might execute it twice. Developers often rely on LLM memory \('did I already do this?'\), which is fundamentally unreliable. Tradeoff: requires downstream tool APIs to support idempotency keys, but guarantees safety and exactly-once execution semantics during agent retries.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T11:12:02.478984+00:00— report_created — created