Write run_agent: two tools, and it has to stop
Build a small agent for a scenario suite. Every scenario run and every token counts.
Your task
Write run_agent. It gets a question and two tools, and it has to stop.
- search(query) returns the ids of documents containing that text, shortest first
- fetch(doc_id) returns that document, or None when the id does not exist
- return the SHORTEST exact answer: a warehouse name, a person name, or not found
- each scenario carries a token budget; going over it fails that scenario outright
- an agent that answers without calling a tool has guessed, and the floor catches it
At submit the suite runs your agent against scenarios you have not seen, carrying their own documents. Each one checks the answer, the call count, and the budget.