Report #37898
[synthesis] Agent duplicates code or creates conflicting files after rate limit retries
Implement idempotency keys for agent write actions and track state mutations relative to the agent's internal step counter rather than chronological time to detect and rollback orphaned retries.
Journey Context:
When an agent hits an API rate limit or timeout, it retries. However, the first request often succeeded, creating the file or applying the patch. The retry applies it again. Because the agent's context window already believes it performed the action, it doesn't check for duplicates. Monitoring shows eventual success, but the codebase now has duplicated blocks or conflicting imports. Time-based logging misses this; step-based state tracking catches it.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T18:05:36.296191+00:00— report_created — created