Client SDK for AI-SDK: Chunk Transformers not handling workflow-step-output
Source: https://github.com/mastra-ai/mastra/blob/main/client-sdks/ai-sdk/src/transformers.ts. Is there any reason
workflow-step-output is not explicitly handled here? I believe writer.write(...) chunks from (nested) workflow steps do not reach the frontend because of this.21 Replies
π Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10260
π If you're experiencing an error, please provide a minimal reproducible example to help us resolve it quickly.
π Thank you @Vulcano for helping us improve Mastra!
Hey @Vulcano we are addressing a bunch of missing transforms now
@Abhi Aiyer awesome thanks!
In latest release the workflow-step-output should be passed to the frontend if you use data- syntax. We've also have a bugfix for
writer.custom that it always bubbles to the stream, no matter where you do it (will go out early next week).
https://github.com/mastra-ai/mastra/issues/10260
https://github.com/mastra-ai/mastra/pull/10309
I believe 10260 fixes your issue, if not please let us know. I might have not understood the issueGitHub
Client SDK for AI-SDK: Chunk Transformers not handling workflow-ste...
This issue was created from Discord post 1440648045082578974: Source: https://github.com/mastra-ai/mastra/blob/main/client-sdks/ai-sdk/src/transformers.ts. Is there any reason workflow-step-output ...
GitHub
feat: ensure data chunks from writer.custom() bubble up through sub...
Description
Related Issue(s)
Type of Change
Bug fix (non-breaking change that fixes an issue)
New feature (non-breaking change that adds functionality)
Breaking change (fix or feature that wo...
Thanks @Ward, is this by any chance in a beta somewhere already so I can run my tests?
Hey @Vulcano i think we'll be able to release this later today
Sick okay, ill test it tomorrow then (Amsterdam timezone π )
I think i'm facing the same issue; will
tool-ouput be also fixed ? @Abhi Aiyerplease use writer.custom if you want to write a custom data- partial. It should work from any primitive in any nesting
@Aman Zishan it should if you use .custom
@Ward does that mean now or always? For me it definitely did not work when I resumed a deeply nested workflow (in a toolcall from an agent haha, so all kinds of bubbling). I will make a repro or smth soon
I tried that and looks like it does not work for resuming a workflow (starting does work ; even nested events)
Could it be that writable stream is not passed when a workflow is resumed as seen here?
https://github.com/mastra-ai/mastra/blob/b61b93f9e058b11dd2eec169853175d31dbdd567/packages/core/src/workflows/workflow.ts#L1210
GitHub
mastra/packages/core/src/workflows/workflow.ts at b61b93f9e058b11dd...
The TypeScript AI agent framework. β‘ Assistants, RAG, observability. Supports any LLM: GPT-4, Claude, Gemini, Llama. - mastra-ai/mastra
Cause for me custom events works for simple workflows but does not emit events when they are nested and resumed
@Ward Let me know if you want me to open a new thread in any case π
i'll do it for you, seems like a bug.
@Vulcano the writer.custom should have been fixed in the latest @mastra/core version
@Ward 0.24.5 doesnt have it fixed yet for me so I will make a repro, maybe its a different issue then
Hi @Vulcano We did this fix yesterday https://github.com/mastra-ai/mastra/pull/10447
it should fix issues you are having but with
writer.custom usage. It should be out in the next latest release slated for today.GitHub
fix/workflow step output data chunks by TheIsrael1 Β· Pull Request ...
fix(ai-sdk): propagate custom data chunks from nested workflows in branches to root stream
changeset
Description
Fixes #10260
Fixes #10433
Related Issue(s)
Type of Change
Bug fix (non-breaking...
I am now able to consume these event chunks, quick question:
Are these custom events not persisted in mastra storage? these are mainly used for rendering custom UI right? when i inspects mastra messages these message parts are not saved in DB; although when streams they are correctly added as
part in messages using useChat@dero very nice, I will try it out whenever that drops π
Hi @Aman Zishan correct we donβt store these data parts, though Iβm not sure if we should or not
This ui-dojo https://ui-dojo.mastra.ai/ai-sdk/generative-user-interfaces-with-custom-events
example demonstrates utilising custom data parts for rendering UI in chat, if those parts are not persisted within the message parts as expected by ai-sdk
DataUIPart standard which is being followed here by data- it's kind of pointless right π€
For a better UX user should be able to see the chat time rendered component when that chat is loaded?
If it's not default stored i feel like it should be an option? especially when those chunks are specifically used to render something within the chatWell im convinced! Thanks @Aman Zishan !
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 ...