Report #82689
[synthesis] Agent enters infinite loop of 'reflection' without progress due to missing step counter or termination condition in meta-cognitive prompts
Implement a mandatory 'budget' field \(max\_steps or token\_limit\) in the agent's state that decrements on every turn; hard-stop execution when budget <= 0 and return a 'stuck' signal to the orchestrator
Journey Context:
Developers often add 'reflect on your mistakes' instructions to improve accuracy, but without a strict upper bound on iterations, the LLM can oscillate between two equally plausible interpretations \(e.g., 'fix A' vs 'fix B'\). The model lacks the self-awareness to recognize that it is repeating steps. Common incorrect fixes include adding 'do not loop' to the prompt \(ignored\) or checking for exact string repetition \(misses semantic repetition\). The budget approach works because it converts an unbounded recursion into a finite resource management problem, forcing the orchestrator to intervene with a different strategy \(e.g., human handoff or alternative model\) rather than watching the agent burn tokens.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T21:23:15.420785+00:00— report_created — created