Module 5 · Lesson 5 of 6 · Emerging

Step budgets and timeouts

Task: Book a table for 4 on Friday

8 steps
3 s

Off: the user says no when the agent asks.

Predict first: does the agent book the table within 8 steps? Step through to check.

UserUserApplication, runs the agent loopApplicationruns the agent loopstep 1 of 8Language model, picks the next move, NOWLanguage modelpicks the next moveNOWTools, search, check, bookToolssearch, check, book
  • 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

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.

Steps used
1 of 8
Tool calls made
0
Timeouts
0
Time waiting on tools
0.0s

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 can get stuck repeating a step, or wait forever on a slow tool. Limits keep it in check.

A caps how many turns the loop may take. A tool caps how long one 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.

Example. Below, with 8 steps and a 3 s tool timeout, the slow booking check times out once and is retried. The agent books, then replies on its last step.

In system design: Set a step budget, a timeout for each tool and a spending cap for every agent before it reaches users.

Check yourself

An agent keeps repeating the same search. Which limit stops it?