while True around a stochastic decision-maker is not a loop, it is a liability. Every agent needs several halt conditions, because each one catches a different pathology and none of them catches the others.
Why loops do not terminate
The naive loop ends when the model stops requesting tools. That is a termination condition supplied by the thing being controlled, which is the wrong direction of control. Four ways it fails to fire:
Oscillation. The agent edits a file, tests fail, reverts the edit, tests fail differently, re-applies the edit. Each step is locally reasonable. The cycle has no exit.
Optimistic re-checking. A tool returns empty. The model concludes it must have made a small mistake and retries with a trivially different query. Forever.






