Step 1 of 50 · Host app → Modeltask + 3 toolsTurn 0 of 12 · context 0 of 3,000 tokens · 0 tokens in all
Chapter 4 of 7
Budgets and stuck loops
In chapter 3 a person approved the agent’s plans. Now the carrier’s tracking stops answering, and the agent keeps asking.
This chapter: What stops an agent that keeps trying the same thing, and what does each try cost?
About this chapter
You will learn
- Why an agent with a failing tool can retry until the host stops it
- Why every turn costs more tokens than the one before
- How a step budget and a repeat detector stop a stuck run, and why only the detector leaves the agent a turn to tell the customer
Words you’ll meet
- Timeout
- A tool call that gets no answer in time. The host returns it as an error result.
- Stuck loop
- An agent asking for the same failing call, turn after turn, without getting anywhere.
- Token
- A small piece of text, a word or part of one. Models read and write tokens, and every turn re-sends the whole context.
- Repeat detector
- A host rule: when the same call fails the same way several times in a row, stop running it and tell the model.
Step 1 of 6
Marlow Builders asks where order 1051 is, but every carrier lookup ends in a . The host’s only rule: a 12-turn step budget.
Predict first.