← Table of Contents · Page 704 of 868

PROJECT FIVE - MULTI-AGENT AND PRODUCTION HARDENING

Part 4 of 11

TESTING THE REPEATED-FAILURE BUG Chapter 56 described a nasty bug in which the same failing tool call is made over and over, ten times in a row, by an agent that never learns. We now reintroduce it deliberately by turning the search tool off, and then check that our safeguard stops it. [START OF POWERSHELL CODE] # Set the environment variable LAB_FAIL_TOOL to simulate the search_job_posting tool being broken $env:LAB_FAIL_TOOL = "search_job_posting" # Run the supervisor on a fresh batch, to see how the system reacts to the broken tool python supervisor.py --fresh [END OF POWERSHELL CODE] On macOS or Linux use export LAB_FAIL_TOOL=search_job_posting instead. You should see output like the following. matcher failed on resume_01.txt -> tool_unavailable finished: 0, failed: [('resume_01.txt', 'tool_unavailable')] steps: 2, tokens by tier: {'cheap': 133, 'strong': 0}, cost: 0.03 lab units (budget 60) Open logs/run_log.jsonl and count the retry events. There should be exactly four, with the waits growing from 0.2 seconds upward, followed by one tool_unavailable event. Without the safeguard the agent would have repeated the failing call until its step limit, with each attempt costing tokens and time. With it, the failure was contained within four attempts and the batch stopped with a clear message. Set the variable back to an empty value afterward so the tool works again.
Advertisement
Read Aloud:
0:00 / 0:00