Playground crashes on maxSteps limits reached

Once receiving following error in console playground crashes with white screen: Uncaught Error: Stream finished with reason tool-calls, try increasing maxSteps Note: increasing maxSteps in playground doesn't help. crash still happens after 5th tool call
8 Replies
Mastra Triager
GitHub
[DISCORD:1426950306352332911] Playground crashes on maxSteps limits...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1426950306352332911 Once receiving following error in console playground crashes with white screen: Uncaug...
_roamin_
_roamin_7d ago
Hi @Guria ! Are you still running into this issue on latest?
Guria
GuriaOP6d ago
@Romain surprisingly it wasn't fixed. mastra 0.16.0-alpha.1
No description
Guria
GuriaOP6d ago
"dependencies": {
"@ai-sdk/amazon-bedrock": "^3.0.35",
"@ai-sdk/openai-compatible": "^1.0.22",
"@aws-sdk/credential-providers": "^3.910.0",
"@mastra/core": "^0.21.0",
"@mastra/libsql": "^0.15.2",
"@mastra/loggers": "^0.10.16",
"@mastra/memory": "^0.15.7",
"dotenv": "^17.2.3",
"zod": "^3.25.76"
},
"devDependencies": {
"@biomejs/biome": "2.2.5",
"@types/node": "^24.6.2",
"@vitest/coverage-v8": "^3.2.4",
"ai": "^5.0.62",
"mastra": "^0.16.0",
"msw": "^2.11.4",
"typescript": "^5.9.3",
"vitest": "^3.2.4"
}
"dependencies": {
"@ai-sdk/amazon-bedrock": "^3.0.35",
"@ai-sdk/openai-compatible": "^1.0.22",
"@aws-sdk/credential-providers": "^3.910.0",
"@mastra/core": "^0.21.0",
"@mastra/libsql": "^0.15.2",
"@mastra/loggers": "^0.10.16",
"@mastra/memory": "^0.15.7",
"dotenv": "^17.2.3",
"zod": "^3.25.76"
},
"devDependencies": {
"@biomejs/biome": "2.2.5",
"@types/node": "^24.6.2",
"@vitest/coverage-v8": "^3.2.4",
"ai": "^5.0.62",
"mastra": "^0.16.0",
"msw": "^2.11.4",
"typescript": "^5.9.3",
"vitest": "^3.2.4"
}
ah wait. these question was related the crash
Guria
GuriaOP6d ago
@Romain ok crash didn't happened, but also there is no output after reaching limit with tool calls it just stops on tool call without producinag any error or chat output
No description
_roamin_
_roamin_6d ago
I see, thanks for testing that out! The thing is I don't believe there is an error generated when using maxSteps 🤔
Guria
GuriaOP6d ago
so is this expected output? or should we allow model to make final summary as last step? not sure if that is good idea
_roamin_
_roamin_6d ago
That is the expected output. There is a better approach now though, which is to use the stopWhen option (which is not available in the playground), but it gives you more flexibility on how to handle when to stop the agentic loop. This is directly derived from the ai-sdk https://ai-sdk.dev/docs/agents/loop-control#stop-conditions
Loop Control
Control agent execution with built-in loop management using stopWhen and prepareStep

Did you find this page helpful?