Skip to main content
Code Guide
Architecture Agentic

max_turns

Agentic loop parameter capping tool-use cycles before halting. Recommended ranges: 5 (simple tasks), 20-30 (research workflows), 50+ (extended pipelines). Check `stop_reason == "max_turns"` after each loop to detect premature halts.