Module 5 · Lesson 5 of 6 · Emerging
Step budgets and timeouts
Task: Book a table for 4 on Friday
Off: the user says no when the agent asks.
Predict first: does the agent book the table within 8 steps? Step through to check.
- User — healthy
- Application — runs the agent loop — healthy — step 1 of 8
- Language model — picks the next move — healthy — NOW
- Tools — search, check, book — healthy
- Request
- Timed out
- Retry
- Reply to the user
Step 1 of 8 · Language model
Done: The model plans: find a restaurant with a table for 4 on Friday
- What happens
- The application sends the task and everything done so far to the model. The model replies with its next move.
- Why
- The model keeps nothing between calls. Each turn it reads the whole story again and picks one move.
- What changes
- The model replies: "Plan: find a restaurant with a table for 4 on Friday."
- Next
- Run search_restaurants
Event log
7 more to go. Press a line to go back to that step.
Step 1 of 8: Language model. The model plans: find a restaurant with a table for 4 on Friday. The application sends the task and everything done so far to the model. The model replies with its next move.
What this simplifies. This agent follows a fixed script with made-up timings, so you can see the limits at work. A real agent decides each step with a model call, so its path changes from run to run. Real budgets often count only model turns. The picture shows one request for each step. In a real loop the model is called again after every tool result.
An (A model that calls tools in a loop, deciding each next step from the results, until it can answer.) can get stuck repeating a step, or wait forever on a slow tool. Limits keep it in check.
A (The most turns an agent's loop may take before it must stop and report what it could not finish.) caps how many turns the loop may take. A tool (The time a caller waits before giving up on a call and treating it as failed.) caps how long one (A request from a model to run one of the functions it was given, such as a search. Your own code runs it.) may take before it counts as failed.
When a limit is hit, the agent stops and tells the user what it could not finish, instead of running up costs.
In system design: Set a step budget, a timeout for each tool and a spending cap for every agent before it reaches users.