Report #73580
[synthesis] Agent loops on 409 Conflict or duplicate key errors by retrying the exact same API call
Inject idempotency awareness into the agent: when a tool returns a 409, 422, or duplicate error, the agent's error handling protocol must dictate reading the current state \(e.g., GET request\) before attempting a new write, rather than blindly retrying the POST.
Journey Context:
LLMs often treat tool calls as pure functions. If a POST fails, the agent assumes it was a transient error and retries the exact same payload. However, the first POST actually succeeded \(or partially succeeded\), making the retry a state violation. The agent needs to be explicitly instructed that write operations mutate state and that conflict errors require a read-before-write pattern to resolve. This bridges functional programming assumptions with REST API statefulness: agents default to statelessness, causing catastrophic loops on stateful endpoints.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T06:06:01.474064+00:00— report_created — created