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, and a planted line got through only when nobody read them. Now a case goes wrong in a way no plan can fix: the carrier’s tracking system 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?
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 (4)
- 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.
The picture on the left is live. Each step below asks you to do one thing in it; the story continues here as you go.
Step 1 of 6
A new case: Marlow Builders asks where order 1051 is. Find out and let them know. The agent can look up the order, ask the carrier where it is, and email the customer. Today the carrier’s system is not answering: every tracking lookup times out. The only rule in the host is the step budget from chapter 2, 12 turns. Before you run it: