Todo List improve error handling in ai agent limit recursive itterations to max iters in ai agent to prevent out of control recursion generating token costs