The Demo Dies at Minute Nine: A Bootcamp Lab on Rehearsing Agent Failures
Your agent demo will not fail because the model is dumb. It will fail at minute nine, when the room goes quiet and the second request hangs. So this lab grades the slow path. Students build one small tool-using agent, park it on a host, and then spend the entire session rehearsing the two things that actually break live: latency and a rejected request. No leaderboard for tokens. No prize for the…
The lab focuses on rehearsing agent failures rather than the happy path. Students build a simple tool-using agent and spend the entire session simulating the two main issues that can cause live failures: latency and rejected requests. No leaderboard or prize is awarded based on token usage or prompt cleverness. The primary goal is to demonstrate that if an agent cannot survive a problematic minute, the prompt loses its significance.
For the lab, students are provided with two essential components: MonkeyCode's free model access and its free server option for hosting the rehearsal runner. Additionally, a free 10 million-token allowance is mentioned, which students should check in their own dashboard rather than relying on static numbers. The lab's core principle is to practice failure scenarios rather than the successful outcomes.
Students craft three scripted prompts and analyze what happens when the network behaves unexpectedly. The developers behind the current agent stacks often add personality through proxies, each adding another potential point of failure. Consequently, the focus shifts from the agent itself to the rehearsal log. The entire setup process takes about 30 minutes and requires minimal dependencies.
The students are instructed to create three files and set up a terminal environment. The entire lab is built using standard libraries only, avoiding unnecessary complexities. The agent runs behind a lightweight local service, ensuring the harness does not need to know which provider is responding. This indirection allows for easy swapping of models while maintaining the contract.
The agent_server.py file, which students write themselves, consists of around 40 lines of code. It defines a POST /turn endpoint that accepts a prompt and returns the model's response. The script.json file contains the scripted prompts, each with a specific turn number and prompt text. The harness, named rehearse.py, times every turn and records the results in a machine-readable log.
The setup process involves creating a directory called lab04, navigating into it, creating a virtual environment, activating it, and verifying the Python version (3.9 or higher is sufficient). The agent communicates with whichever model endpoint the user's key is associated with. The scripted prompts are stored in the script.json file, which includes three prompts for the demo.
After running the prompts, students analyze the results, focusing on the latency and rejection rates.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.