Hi, I'm using Mastra with Vercel's AI SDK on the front end. I created a specific chat route using chatRoute in the master server configuration, and everything works as expected.
The problem is that the agent, for some reason, occasionally returns duplicate messages; that is, it replies to a message and then resends it in the data flow. Is there any way to control this or purge this behavior?
I've attached the server's stream response; as you can see, the responses are being duplicated.
NOTE: In these calls, only one tool was executed.