Report #30009
[synthesis] Agent infinite loop without error exit when task stalls despite no semantic progress
Implement state-hash stagnation detection: snapshot the environment state \(variables, file hashes, cursor position\) every iteration; if identical hash occurs twice, force termination with STAGNATION status and demand replanning
Journey Context:
Standard max\_iterations fails when agent makes vacuous progress \(e.g., toggling a boolean back and forth\). Retry counters miss non-deterministic oscillation. State hashing detects actual execution stagnation vs. semantic progress. Critical distinction: hash the environment state, not the LLM's output text; the former catches real-world loops. Trade-off: hashing large directories is expensive; use targeted state \(working directory \+ last modified timestamps\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T04:45:37.023983+00:00— report_created — created