Exercise 05 — Debug Looping Agent¶
Timebox: 30 minutes
Goal¶
Use buggy_agent.py to practice debugging an agent that keeps repeating the same failing tool call.
Work in¶
buggy_agent.py
Tasks¶
- Add an explicit iteration cap.
- Stop repeating the same failing tool call forever.
- Surface a clean failure when the tool keeps failing.
- Log enough trace information to explain what happened.
Done when¶
- The script terminates cleanly
- The failure is visible and understandable
- The agent does not keep retrying the same broken step forever