Agent loop burned tokens without progress
No budget cap or stall detection, so the loop spent tokens for hours while making no real progress.
What happens
A long-running loop iterates over and over, re-sending large context each turn, without converging. Cost climbs while the goal stays out of reach.
Why it happens
No budget cap, no max-iteration limit, and no stall threshold — nothing stops a loop that is not progressing.
The loop engineering fix
Set a budget cap and a max-iteration limit before starting.
Add a stall threshold: stop after N iterations with no measurable progress.
Estimate per-run and monthly cost first, and pass summaries instead of full context.