Your agent loop has no cost ceiling. Here is the fix.
A developer has published a small, drop-in Python pattern for capping agent-loop costs by wrapping each model call in a per-task budget that records token spend by step and raises a BudgetExceeded err…