vercel / vercel/resumable-stream

Issues with AI SDK v5

Open
#22 0 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
574
Forks
44
Avg merge
3m
Merged PRs (30d)
1

Description

I've been having some issues integrating resumable-stream into a non-Next.js setup.

And specifically, I've been wondering about the need to do this:

const result = streamText({
  model: google('gemini-2.0-flash-001'),
  messages: convertToModelMessages(messages),
});

const stream = result.toUIMessageStream();

const resumableStream = await streamContext.resumableStream(
  dbStream.id,
  () => stream.pipeThrough(new JsonToSseTransformStream()), // THIS!
);

Why is it required to pipe the stream through JsonToSseTransformStream before sending it to resumable-stream?

Shouldn't resumable-stream integrate better with AI SDK v5, and use UIMessageStream as its input? Or at least provide a compat layer.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the resumableStream call and the JsonToSseTransformStream usage shown in the issue, then compare their expected inputs with the AI SDK v5 UIMessageStream. Define the desired compatibility behavior and how it should work in a non-Next.js setup; the issue does not name tests or files to update.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.