Idempotency Keys Fail When Models Write Requests
benyounesarabah · reddit · 2026-07-13
The author points out that many idempotent designs assume "retries send the exact same request bytes," allowing a payload hash to serve as an idempotency key.
However, in agent workflows, this assumption often fails:
- If a step fails and the orchestrator reruns it, the model regenerates the tool call.
- The intent remains the same, but the bytes differ: phrasing changes, JSON field order shifts, and timestamps update, all altering the hash.
- As a result, the deduplication layer treats it as a brand-new request, causing actions like sending emails to execute multiple times.
Therefore, idempotency keys shouldn't be derived from the payload but from the workflow itself:
- Assign a stable identity to "a specific logical step within a specific run"
- Or identify by (runid, toolname, attempt), though this might miss reordered steps
The author is searching for a more robust solution to keep model-driven steps maintaining a stable identity during retries.
More from coding & agent
- Coding agents are heading toward an AI-writes, AI-reviews, human-approves workflow — aftahi_ai · 2026-07-22
- oMLX 0.5.2 adds Mac menu-bar stats, low-bit decode kernels, and faster downloads — awnihannun · 2026-07-22
- GitHub review bot hits its PR limit and forces a 39-minute cooldown — DanielLockyer · 2026-07-22
- Max reasoning effort appears to be mobile-only in Codex Remote, not desktop — GabGarrett · 2026-07-22
- A Reddit demo argues online stores should expose carts and pricing through MCP — gelembjuk · 2026-07-22
- Open-source AI SDK provider routes Vercel apps through a local Codex subscription — lgrammel · 2026-07-22