Skip to content

[v6.0] reproduction: resumeStream duplicates the previous assistant message: streaming state - #18493

Draft
ai-sdk-factory[bot] wants to merge 1 commit into
release-v6.0from
bug-reproduction-18457-20260805215611459250
Draft

[v6.0] reproduction: resumeStream duplicates the previous assistant message: streaming state#18493
ai-sdk-factory[bot] wants to merge 1 commit into
release-v6.0from
bug-reproduction-18457-20260805215611459250

Conversation

@ai-sdk-factory

@ai-sdk-factory ai-sdk-factory Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Bug

resumeStream duplicates the previous assistant message: streaming state is seeded from the last message, then the start chunk renames its id and breaks the replace-vs-append check

Reproduction

  • On the release-v6.0 target (ai 6.0.243), resumeStream() preserved assistant message a1 but also appended server-msg-2 containing both the copied previous answer and the newly resumed answer.
  • Expected behavior is for a1 to remain once and for server-msg-2 to contain only the resumed answer.
  • packages/ai/src/ui/process-ui-message-stream.ts seeds state from the last assistant message and renames it on the replayed start chunk; packages/ai/src/ui/chat.ts then appends it because its ID no longer matches the last persisted message.
  • The runnable reproduction is examples/ai-functions/src/reproduction/issue-18457-resume-stream-duplicates-previous-message.ts; it uses an in-memory transport without network access or provider configuration.

Relevant Documentation

Related Issues

Reproduces #18457

Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant