stop_when:
has_tool_call(...) and finish_reason_is(...). Keep a step or duration bound even when using cost or token limits because those depend on reported usage.
Bound Python agent work by steps, tokens, cost, duration, tools, or finish reason.
stop_when:
has_tool_call(...) and finish_reason_is(...). Keep a step or duration bound even when using cost or token limits because those depend on reported usage.