Question: are data- events persisted in mastra when used with ai-sdk?
My setup leverages
chatRoute and useChat from ai-sdk, i use data- partial events to expose deeply nested workflow step updates all the way to the supervisory agent stream generative UI.
But upon fetching messages from storage and converting to UIMessages i don't see the emitted events persisted and hence the components are not rendered when i refresh the chat.
I'm on v1 beta6 Replies
๐ Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10477
๐ 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!
@Aman Zishan currently we do not persist them, but we actually should. This woudl help with ui creation as you mentioned
Agreed, right now it feels weird to see them dissappear on load; i had a convo here as well https://discord.com/channels/1309558646228779139/1440648045082578974
@Ward should i raise a feature request so i can track the timeline?
It works very nicely with UI creation; no need to bloat the agent context will non functional tool calls just to render a component in client. If those events could be persisted would be really great
Hey @Aman Zishan ! You can actually just follow the github issue above ๐ (https://github.com/mastra-ai/mastra/issues/10477)
GitHub
Persist data- events in mastra ยท Issue #10477 ยท mastra-ai/mastra
This issue was created from Discord post 1442841150250811515: My setup leverages chatRoute and useChat from ai-sdk, i use data- partial events to expose deeply nested workflow step updates all the ...
Are you planning to keep it in same message with parts type
data-*?I would expect the behaviour to be same as when its streamed so we can avoid a post process after stream. Just like how tool-call is persisted