Skip to content

fromFullStream uses step-finish but AI SDK v5+ emits finish-step #238

@nvergez

Description

@nvergez

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

  1. Use AI SDK v6 with a multi-step agent (tool calls between text steps)
  2. Stream via thread.post(result.fullStream)
  3. Observe that text from different steps is concatenated without paragraph breaks
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions