maxSteps in agent network

Is there are a way of increasing the number of maxSteps for the subagents of an agent network? I've set maxSteps in defaultGenerateOptions and defaultStreamOptions for all the agents in the network, and also in the request:
const body = await req.json();
13 const { messages, memory, maxSteps = 200 } = body;
14
15 // Call the Mastra chat endpoint (uses chatRoute which provides AI SDK format)
16 const response = await fetch('http://localhost:4111/chat/scenarioCoordinatorAgent', {
const body = await req.json();
13 const { messages, memory, maxSteps = 200 } = body;
14
15 // Call the Mastra chat endpoint (uses chatRoute which provides AI SDK format)
16 const response = await fetch('http://localhost:4111/chat/scenarioCoordinatorAgent', {
but this only works for the supervisor of the network (scenarioCoordinatorAgent in my implementation), and subagents stop abruptly after exceeing default value for maxSteps (5) I am not sure if this is a bug or that I can't find the right way of setting this up. Sorry if this landed in the wrong channel!
4 Replies
Mastra Triager
Mastra Triager•3d ago
šŸ“ Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10866 šŸ” If you're experiencing an error, please provide a minimal reproducible example whenever possible to help us resolve it quickly. šŸ™ Thank you for helping us improve Mastra!
Bernardo Garcia
Bernardo GarciaOP•3d ago
Found a workaround by using legacy defaultVNextOptions I am on this version:
"@mastra/ai-sdk": "^0.3.2",
"@mastra/core": "^0.24.6",
"@mastra/ai-sdk": "^0.3.2",
"@mastra/core": "^0.24.6",
Abhi Aiyer
Abhi Aiyer•3d ago
Hi Bernardo that is the solution in 0.x versions. In 1.0 we have it properly in default options But yes in a network, max steps applies to the routing agent!
Bernardo Garcia
Bernardo GarciaOP•3d ago
Understood! thanks for the reply šŸ™‚

Did you find this page helpful?