Report #39538
[architecture] Retrying a failed agent step causes duplicate external side effects like duplicate API calls or database writes
Implement idempotency keys for external side effects at the agent execution layer. Pass a unique task\_id and step\_id to the agent, which it must include as an idempotency key when calling external APIs.
Journey Context:
Orchestrators naturally retry failed agent executions. If an agent performs a side effect on step 3 but crashes on step 4, the orchestrator's retry re-runs step 3. Without idempotency keys, the external system treats it as a new request. By injecting an orchestrator-generated idempotency key into the agent's context, external calls become safe to retry without duplicating state.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T20:50:28.489252+00:00— report_created — created