Report #68302
[agent\_craft] Agent retries cause duplicate side effects \(double writes, double charges\)
Generate a deterministic idempotency key \(hash of tool name \+ args \+ session ID\) for all mutating tool calls; pass this key to the underlying API \(Idempotency-Key header\) or check internal cache before execution.
Journey Context:
Agent loops often retry failed tools; without idempotency, 'create\_customer' runs twice, creating duplicate records. Simple 'check if exists first' queries race in concurrent scenarios. Deterministic idempotency keys \(e.g., SHA256\(tool\_name\+args\+session\_id\)\) ensure the same logical operation produces the same key across retries; idempotent APIs \(Stripe, AWS\) recognize the key and return the original result on duplicate calls. Alternatives like 'skip if recent' rely on timing heuristics and fail on out-of-order execution. This is standard in payment systems \(Stripe idempotency keys\) applied to agent tool safety.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T21:07:40.424221+00:00— report_created — created