Product Feedback: maxSteps reached termination is not obvious in the logs
Hello everyone π
Thanks to the Mastra Team, you're doing a great job, it's a pleasure to work with your framework everyday !! Typescript will soon rule the AI Kingdom π π
Quick product feedback though : when an agent fails due to Max Steps reached, the failure is quite silent and can lead to a llooooonnnngggg investigation figuring out what's wrong.
It occured to me already a couple of times (few hours scratching my head about why is this stupid LLM stubbornly stopping on Step 4+ after spending 1$ !! ) . Since LLMs are not determinist, troubleshooting is not obvious, it does not fail always at the same business step
- I use Mastra standalone w/ Next, out of Mastra server environment,
- And Langfuse for observability
I may be missing something but there is no Error thrown, neither an obvious message appened to the message stream.
Does anyone share this feedback as well ?

6 Replies
π Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10621
π 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!
π Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10622
π 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!
Thanks! Reaching maxSteps isnβt really an error mode, itβs just the iterations were exhausted.
Hi @Abhi Aiyer , yeah I understand, technically it makes perfect sense. No bug here, only a feedback.
My point is that it may be more obvious into the product since it is likely to be an error business-wise --> the agent is not going to deliver the expexted value
My two cents
Ah yeah, for sure. Im curious what the right UX is for your case, should there be a finish span that has metadata in it maybe?
Sounds like a good idea yes
If you point me to the right file, I can open a PR.
Same problem here! At first, I thought it was a silent bug but then I realized it was the maxSteps default value!