max_turns

Domain: Agent Architecture

Motivation

max_turns stops the agent from looping forever. It is a safety limit on how many turns one conversation can take.

Concrete Example

If max_turns is 25, the agent stops after 25 turns even if the model keeps asking for more tools.

Analogy

Like a game with extra time: when the whistle blows the game ends no matter what.