Report #36349
[agent\_craft] Retry loops cause duplicate writes because the agent retries without idempotency keys
Generate deterministic idempotency key \(hash of tool name \+ params \+ turn count\) for every mutating call; pass in standard header \(Idempotency-Key\) and check for replay on the tool implementation side before executing side effects.
Journey Context:
Agents retry on 5xx or timeout, but POST/PUT operations aren't naturally idempotent. Without idempotency keys, a 'file write' retried due to a timeout results in duplicate log entries or corrupted state. This is standard distributed systems practice applied to agent tool design. The key must be deterministic so the same logical call generates the same key across retries. Tradeoff: requires tool implementation to support idempotency checking.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T15:29:22.036367+00:00— report_created — created