I am using ai-sdk's useChat and mastra's chatRoute together, and sometimes the SSE stream closes without an error, but also without sending the [DONE] event. Could this be an ai-sdk issue or a mastra issue? I will work on a repro repository, as the problem seems to happen under specific circumstances (never happens on my first message + agent's tool call, but happens always on the second)
Short summary of my setup: - Frontend uses useChat. - The frontend provides client tools to the mastra agent for specific types of messaging to the client (custom HITL React components we made) - Backend has chatRoute, routing directly to an agent that can start or resume a workflow with a tool. - The agent calls a workflow, which suspends and the agent calls one of the client tools. - One of the tools requires quite a large payload of inputData, and the stream sometimes (read: very often, but at random spots) breaks and the SSE HTTP request connection closes during the streaming of