What does "Max turns (10) exceeded" mean in an agent run?
In the OpenAI Agents SDK, “Max turns (10) exceeded” means the run used up its allowed turns, each one an LLM call, without the agent producing a final output, and the SDK raised MaxTurnsExceeded. The default is 10 and the number in the message is whatever max_turns was set to.
A turn that calls a tool or hands off leads to another turn, so a run that never produces a final answer continues until the cap stops it. The SDK docs let you pass a larger max_turns, pass None to remove the limit, or register an error_handlers entry for max_turns that returns a fallback output instead of raising.
Read the trace before changing any of them. Ten turns of the same tool call is a loop, and a larger cap just runs it longer; an agent that loops needs a bound outside the model’s judgment. Passing None removes the turn limit, so nothing in this setting stops a loop.
A handler that returns a fallback makes the run look like a normal completion, so count how often it fires.
published