Report #69616
[synthesis] Agent enters infinite loop without error due to non-deterministic state mutation between iterations
Implement convergent loop invariants: require every loop iteration to produce a strictly monotonic progress metric \(e.g., 'items\_processed' count must increase by >=1\) and enforce a maximum delta threshold between current and previous state snapshots \(using structural diff\), aborting if state oscillates or stagnates.
Journey Context:
Agents often use while-loops with conditions like 'while not task\_complete'. Inside, they call tools that mutate external state \(update DB, write file\). Non-determinism arises: network latency causes tool A to sometimes complete before tool B, or race conditions in external APIs cause state to flip between values. The loop condition never stabilizes, but no exception is thrown. Common mistake: relying on idempotency assumptions. Alternative: static iteration limits \(breaks legitimate long tasks\). The invariant approach treats the loop as a convergent distributed system: it must make measurable progress or halt, preventing silent infinite cycling that burns tokens and corrupts external state through repeated partial mutations.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T23:20:03.136833+00:00— report_created — created