Skip to main content
Compose stop helpers through stop_when:
Additional helpers include 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.
Last modified on July 26, 2026