Errors received with Agents SDK

Hi, I’m using the agents as follows:

  • Orchestrator;
    • Subagents;
      • Tools;

Problems: Sometimes, for some reason, I get the following error (“The model did not produce a final response!”). How do I resolve this? I already mentioned in the instructions that it always needs to generate a response before completing an execution, but even so, the error sometimes reappears.

Another error that appears is that MaxTurns() has been exceeded. Like, why does it loop? I set MaxTurns to 50, and sometimes it uses 50; it doesn’t make sense.

The traces panel doesn’t provide any details about the errors.

Note: I’m using it in stream mode, gpt 4.1-mini, temperature 0.2 and in js.

I’m having the same error: Model did not produce a final response!
But, in my case, I’m not setting MaxTurns, I’m using max_tokens=100 in ModelSettings. The model I use is gpt-4.1, and python. My goal is to make the agent not talk so much, and given verbosity parameter is only available for gpt-5 models, I want to restrict the output length using max_tokens, any comment if this is a good idea or how to solve that Model did not produce a final response error?