Agents, lesson 8
Knowing when to stop
Step limits, budgets and done conditions.
You know the agent loop from "Observe, decide, act": it ends when the model replies without asking for a tool.
Part 1. The model says it's done
The normal ending is the model's own choice: it stops asking for tools and writes an answer. That works most of the time. It fails in two opposite ways. Some runs stop too early, announcing success that didn't happen. Others never stop, trying the same thing again and again.
Here's the early stop. A coding agent edits a function and replies: "Fixed the bug. All tests pass now." The trace shows it edited the file and never ran the tests.
Your turn
What's the real problem in that run?
Part 2. Hard caps
Keep going with Pro
You've done the first part. Pro opens the rest of this lesson, and every other one.
- Hard caps
- Spotting a stuck agent early
- Check before you accept done
- Why the check has to come from outside
Agents overviewSpotted a mistake? Tell us.