-
Notifications
You must be signed in to change notification settings - Fork 93
Description
Bug Description
fromFullStream() (added in #170) checks for step-finish events to inject paragraph
separators between steps. However, AI SDK renamed this event from step-finish to
finish-step in v5.0 as part of the finish event
changes.
As a result, thread.post(result.fullStream) with AI SDK v5/v6 silently ignores all step
boundaries — multi-step agent output is concatenated without \n\n separators.
The fix is a one-line change in packages/chat/src/from-full-stream.ts line 47:
- } else if (typed.type === "step-finish") {
+ } else if (typed.type === "finish-step") {The tests in from-full-stream.test.ts also need updating — they currently mock { type:
"step-finish" } which masks the bug.
Steps to Reproduce
- Use AI SDK v6 with a multi-step agent (tool calls between text steps)
- Stream via thread.post(result.fullStream)
- Observe that text from different steps is concatenated without paragraph breaks
- Inspect the fullStream chunks — they emit { type: "finish-step" }, not { type:
"step-finish" }
Expected Behavior
Multi-step agent responses streamed via thread.post(result.fullStream) should have
\n\n paragraph breaks between steps, as documented in the streaming guide.
Actual Behavior
Step separators are silently ignored — all text from different steps is concatenated
without breaks. fromFullStream() listens for step-finish (the AI SDK v4 name) but AI
SDK v5/v6 emits finish-step.
Code Sample
Chat SDK Version
4.20.0
Node.js Version
No response
Platform Adapter
Slack
Operating System
macOS
Additional Context
No response