Report #36824
[synthesis] Agent retries ambiguous tool calls assuming idempotency, but tool is stateful/cumulative, causing duplicate side effects
Label every tool with idempotency keys \(true/false/conditional\) in the schema; if false, enforce strict exactly-once execution semantics using client-generated idempotency tokens passed to the tool.
Journey Context:
Agents often encounter network blips or ambiguous timeouts. The default recovery pattern is 'retry with exponential backoff'. However, many tools are not idempotent. Example: 'send\_email' - retrying sends two emails. 'charge\_credit\_card' - retrying charges twice. 'append\_to\_log' - retrying duplicates log lines. Even 'create\_file' can be non-idempotent if the content is timestamped. Developers often assume 'read operations are safe, write operations are dangerous', but this is wrong: 'GET /api/execute\_script' can be stateful. The fix requires explicit metadata: the tool schema must declare idempotency characteristics. For non-idempotent tools, the agent must generate an idempotency key \(UUID\) and pass it with the request. The tool provider must honor this key \(ignore duplicates\). The agent must cache this key and not regenerate it on retry. This pattern is standard in payment APIs \(Stripe idempotency keys\) but rarely applied to general agent tools.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T16:17:23.394814+00:00— report_created — created