Skip to content

Backport #3564: Verify stream completion on clean EOF in the reconnecting framed reader - #3588

Open
github-actions[bot] wants to merge 1 commit into
stablefrom
backport/pr-3564-to-stable
Open

Backport #3564: Verify stream completion on clean EOF in the reconnecting framed reader#3588
github-actions[bot] wants to merge 1 commit into
stablefrom
backport/pr-3564-to-stable

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Automated backport of #3564 to stable (backport job run).

AI recommendation: This is a data-loss/correctness fix: createReconnectingFramedStream trusted a clean EOF as end-of-stream, so long live reads were silently truncated when the server's max-duration abort arrived as a graceful close. The buggy code exists verbatim on stable (packages/core/src/serialization.ts:691, including the "Clean EOF — stream is truly complete" branch), and stable has an equivalent metadata API (World.getStreamInfo(name, runId) returning { tailIndex, done }) the fix can use, though the call site differs from main's world.streams.getInfo(runId, name) and will need adapting. Changeset is a patch to @workflow/core and the only other file is an accompanying test.

Merge conflicts were resolved by AI (opencode with anthropic/claude-opus-5). Please review the conflict resolution carefully before merging.

…er (#3564)

Long live reads were ending silently at the server's 2-minute connection
cap: the max-duration abort reaches the client as a clean EOF on some
transport paths, and the reader read that as end-of-stream. On EOF it
now consults `streams.getInfo` and reconnects from the next chunk unless
the stream is done and every chunk up to the tail was delivered. A
failed metadata read trusts the EOF, so a transient blip can't fail a
healthy completion.

Tests added for the reconnect, verified-completion, metadata-failure,
and reconnect-budget paths.

---------

Signed-off-by: Alex Langenfeld <alex.langenfeld@vercel.com>
Signed-off-by: Alex Langenfeld <alexlangenfeld@gmail.com>
@github-actions
github-actions Bot requested review from a team and ijjk as code owners August 17, 2026 18:09
@changeset-bot

changeset-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ff5613e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@workflow/core Patch
@workflow/builders Patch
@workflow/cli Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/vitest Patch
@workflow/web-shared Patch
@workflow/web Patch
workflow Patch
@workflow/world-testing Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch
@workflow/nuxt Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview Aug 17, 2026 6:11pm
example-nextjs-workflow-webpack Ready Ready Preview Aug 17, 2026 6:11pm
example-workflow Ready Ready Preview Aug 17, 2026 6:11pm
workbench-astro-workflow Ready Ready Preview Aug 17, 2026 6:11pm
workbench-express-workflow Ready Ready Preview Aug 17, 2026 6:11pm
workbench-fastify-workflow Ready Ready Preview Aug 17, 2026 6:11pm
workbench-hono-workflow Ready Ready Preview Aug 17, 2026 6:11pm
workbench-nestjs-workflow Ready Ready Preview Aug 17, 2026 6:11pm
workbench-nitro-workflow Ready Ready Preview Aug 17, 2026 6:11pm
workbench-nuxt-workflow Ready Ready Preview Aug 17, 2026 6:11pm
workbench-python-workflow Error Error Aug 17, 2026 6:11pm
workbench-sveltekit-workflow Ready Ready Preview Aug 17, 2026 6:11pm
workbench-tanstack-start-workflow Ready Ready Preview Aug 17, 2026 6:11pm
workbench-vite-workflow Ready Ready Preview Aug 17, 2026 6:11pm
workflow-docs Ready Ready Preview, v0 Aug 17, 2026 6:11pm
workflow-swc-playground Building Building Preview Aug 17, 2026 6:11pm
workflow-tarballs Ready Ready Preview Aug 17, 2026 6:11pm
workflow-web Ready Ready Preview Aug 17, 2026 6:11pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants