Agent loops: when an agent won't stop
Why does an AI agent sometimes keep trying the same thing, and how do you make it stop?
An agent keeps repeating a step that isn't working, and you pay for every try. Only the model decides when it's done, so your code has to decide when it must stop.
