Asked about Tests for prompts, tools and agent loops
How do you test an agent without calling a model?
An answer that works
Replace the model with a scripted fake that returns a planned sequence of tool calls and answers. Then test the loop's behaviour: tools run with the right arguments, results are fed back, budgets and repeat guards trigger, errors become tool results. Model quality is left to evals.
Then they push further
Is that not testing a fantasy? The real model will not follow your script.
It tests your code, which is deterministic and should be correct for any sequence the model might produce. Scripts that include odd sequences, such as repeated calls or unknown tools, are exactly what the real model will eventually do.
What gets marked up
Marked up for a clear split: tests for the deterministic loop, evals for model behaviour.
Reading an answer is not being able to give one. The section that teaches this is Tests for prompts, tools and agent loops, 4 hours of Testing.
Learn this properly