hotai.news
← Back to AI WikiAI Wiki / Core concepts

What are stopping conditions? Completion, pauses, and failure in agent loops

Understand stopping conditions through repeated searches, including result evidence, step caps, human interruption, and the difference between termination and success.

HotAI.news · Sources checked with CodexPublished on 2026-10-20Sources checked on 2026-10-20
Our take

Understand the concept

Stopping conditions define when an agent or workflow ends or pauses, such as verified results, exhausted budgets, or required human decisions. Runtimes should enforce them rather than relying only on the model. Termination is not success; report exhausted budgets and failures, and verify writes before restarting to prevent duplication.

01

Completion needs observable evidence

A research assistant needs an announcement supporting its claim, not merely three searches. Inspect the source for the fact before answering. Step counts limit work but do not establish evidence quality; absent evidence should remain unconfirmed.

Code tasks can use relevant passing tests, with checks that they cover the change. A model’s completion statement is a signal rather than execution evidence. This is condition design without a real tool-loop test or universal completion detector.

02

Budgets and error thresholds limit futile continuation

AutoGen offers termination mechanisms based on counts or text, and Anthropic discusses iteration caps. Applications should define limits plus timeouts and cancellation. Framework step definitions differ, so turns are not necessarily tool-call counts.

Repeated identical failures call for recording the cause and stopping futile retries or using an authorized alternative. Rephrasing does not fix missing permissions. Preserve progress and outstanding work when a budget ends without marking it successful.

03

Resumption must prevent repeated external actions

Define resumption points after human interruption. A timed-out submission may have succeeded; reconcile before resending. Idempotency helps only within its implemented key and scope, not merely because a tool has a particular name.

Mocks can simulate failure and duplicate results to verify limits and state. This describes validation without business writes. Report completion, human waiting, or failure separately; precise state is more useful than simply saying the loop ended.

Checked sources

These sources support the concepts and methods described here. Examples and test scope are labeled separately; check the version of the tools you use.

Back to AI Wiki ↗