Duplicate Requests from Mastra Agent Causing Gateway Timeout
Hi everyone,
I’m encountering an issue with the Mastra agent where it seems to attempt regenerating messages multiple times, resulting in 2–3 identical requests for the same output. This is causing a Gateway Timeout error (504) in my application.
Here’s a snippet of the error:
Has anyone experienced this behavior before? Is there a recommended way to prevent the agent from sending multiple duplicate requests when generating messages?
Thanks in advance!

2 Replies
📝 Created GitHub issue: https://github.com/mastra-ai/mastra/issues/8352
GitHub
[DISCORD:1422886799860306051] Duplicate Requests from Mastra Agent ...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1422886799860306051 Hi everyone, I’m encountering an issue with the Mastra agent where it seems to attempt...
Hi @Raha ! I haven't seen this issue before. Would you mind sharing a small repro example? https://stackoverflow.com/help/minimal-reproducible-example
Stack Overflow
How to create a Minimal, Reproducible Example - Help Center
Stack Overflow | The World’s Largest Online Community for Developers