Knowing When to Stop: The Hardest Part of an Agent Loop
Everyone who designs an agent loop spends their time on two steps. They tune the generate step, because that's where the intelligence appears to live. They harden the verify step, because that's where the discipline lives. Almost nobody budgets serious design effort for the third step, which is the one that actually determines whether the loop is trustworthy: the stop.
Here is the uncomfortable mechanical fact underneath every loop you have ever built. A turn that produces text with no tool call is the only place a run can stop. That's it. That's the entire exit condition — the absence of a function call. And that single signal conflates three completely different situations, which is why agents routinely "finish" tasks they never did.
This post assumes you already have a loop — generate, verify, correct — and that it has burned you at least once. We're going one level down, into the exit.