Skip to content

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

Merged
pranaygp merged 2 commits into
stablefrom
backport/pr-3564-to-stable
Aug 24, 2026
Merged

pranaygp merged 2 commits 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: b805ffc

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, v0 Aug 24, 2026 10:43pm
example-nextjs-workflow-webpack Ready Ready Preview, v0 Aug 24, 2026 10:43pm
example-workflow Ready Ready Preview, v0 Aug 24, 2026 10:43pm
workbench-astro-workflow Ready Ready Preview, v0 Aug 24, 2026 10:43pm
workbench-express-workflow Ready Ready Preview, v0 Aug 24, 2026 10:43pm
workbench-fastify-workflow Ready Ready Preview, v0 Aug 24, 2026 10:43pm
workbench-hono-workflow Ready Ready Preview, v0 Aug 24, 2026 10:43pm
workbench-nestjs-workflow Ready Ready Preview, v0 Aug 24, 2026 10:43pm
workbench-nitro-workflow Ready Ready Preview, v0 Aug 24, 2026 10:43pm
workbench-nuxt-workflow Ready Ready Preview, v0 Aug 24, 2026 10:43pm
workbench-python-workflow Error Error v0 Aug 24, 2026 10:43pm
workbench-sveltekit-workflow Ready Ready Preview, v0 Aug 24, 2026 10:43pm
workbench-tanstack-start-workflow Ready Ready Preview, v0 Aug 24, 2026 10:43pm
workbench-vite-workflow Ready Ready Preview, v0 Aug 24, 2026 10:43pm
workflow-docs Ready Ready Preview, v0 Aug 24, 2026 10:43pm
workflow-swc-playground Ready Ready Preview, v0 Aug 24, 2026 10:43pm
workflow-tarballs Ready Ready Preview, v0 Aug 24, 2026 10:43pm
workflow-web Ready Ready Preview, v0 Aug 24, 2026 10:43pm

@github-actions

github-actions Bot commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor Author

🧪 E2E Test Results

❌ Some tests failed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 1099 0 78 1177
✅ 💻 Local Development 1198 0 86 1284
✅ 📦 Local Production 1198 0 86 1284
✅ 🐘 Local Postgres 1198 0 86 1284
✅ 🪟 Windows 107 0 0 107
❌ 🌍 Community Worlds 83 105 9 197
✅ 📋 Other 606 0 36 642
Total 5489 105 381 5975

❌ Failed Tests

🌍 Community Worlds (105 failed)

redis (20 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01M0TZ293WHFSRJ26GGK9ZRXPR
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01M0TZ2H1CJ8XNTWMF2S796PAK
  • sleepingWorkflow | wrun_01M0TZ3G3GKG48J1K4ME4XGQ7X
  • outputStreamWorkflow negative startIndex (reads from end)
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns correct index after stream completes
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns -1 before any chunks are written
  • outputStreamWorkflow - getTailIndex and getStreamChunks getStreamChunks returns same content as reading the stream
  • error handling serialization failures step-argument serialization failure is catchable in workflow code
  • error handling serialization failures uncaught step-argument serialization failure fails the run as USER_ERROR without redelivery retries
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01M0TZBS9F53CHXXZTXJC3SGEE
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01M0TZC6318VBM0KE349KW6RRR
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01M0TZCDN9MHTMAD1THHTJ7JSJ
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01M0TZCTRQGQD5TSEC1BJ5Q7T9
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01M0TZDMNRW4J42PSGDMAHWBBS
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01M0TZDR9K95QTBBK6K9DQDKK4
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01M0TZDYCMSJEA82ANRGHYR3QH
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01M0TZE2702A93V5RBTX8SM7WM
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01M0TZEB952M20J7VD2F90ZBPF
  • pages router sleepingWorkflow via pages router
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01M0TZM0MTC35V26MFHZG186RV

turso (85 failed):

  • addTenWorkflow | wrun_01M0TZ14ABBQ9X86F0RCJ9DKNJ
  • addTenWorkflow | wrun_01M0TZ14ABBQ9X86F0RCJ9DKNJ
  • deploymentId: 'latest' is a no-op in non-Vercel worlds
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01M0TZ249EDW8PQE5JAMB25GY8
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01M0TZ1CF3FA1W0RACCW7FAX13
  • promiseRaceWorkflow | wrun_01M0TZ1H5JRFW546YM77G916D4
  • promiseAnyWorkflow | wrun_01M0TZ1KG4RAD14RWAERWV2FH9
  • importedStepOnlyWorkflow | wrun_01M0TZ2MFV7PKXJPYZ953CKYGW
  • readableStreamWorkflow | wrun_01M0TZ1NRBZ4PA1TNF9JW5SRC0
  • hookWorkflow | wrun_01M0TZ21WXJVB8FQFCN0TNH8NB
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01M0TZ293WHFSRJ26GGK9ZRXPR
  • webhookWorkflow | wrun_01M0TZ2DBCBD42E54Y2273DH8V
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01M0TZ2H1CJ8XNTWMF2S796PAK
  • sleepingWorkflow | wrun_01M0TZ3G3GKG48J1K4ME4XGQ7X
  • parallelSleepWorkflow | wrun_01M0TZ3ZN08CR6AQNFNNNDD4WF
  • sleepWinsRaceWorkflow | wrun_01M0TZ434H1PM85F458SDM7WSC
  • stepWinsRaceWorkflow | wrun_01M0TZ46JBBPTS1SECZ97P5N3A
  • nullByteWorkflow | wrun_01M0TZ4A0F6CQS4MN8JR1PHBR8
  • workflowAndStepMetadataWorkflow | wrun_01M0TZ4C9GPS71GJV5D4H7NBQZ
  • outputStreamWorkflow no startIndex (reads all chunks)
  • outputStreamWorkflow positive startIndex (skips first chunk)
  • outputStreamWorkflow negative startIndex (reads from end)
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns correct index after stream completes
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns -1 before any chunks are written
  • outputStreamWorkflow - getTailIndex and getStreamChunks getStreamChunks returns same content as reading the stream
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions | wrun_01M0TZ6PRFDBXWAQQJMH82NK30
  • writableForwardedFromWorkflowWorkflow | wrun_01M0TZ72M6HXX790YM6HTETS41
  • writableForwardedFromStepWorkflow | wrun_01M0TZ75XE1ZD34S00WH51GBCZ
  • fetchWorkflow | wrun_01M0TZ78ERNRFDKAGGF89QC7GN
  • promiseRaceStressTestWorkflow | wrun_01M0TZ7BX3TDC8MPZWY34BVE8X
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • error handling serialization failures step-argument serialization failure is catchable in workflow code
  • error handling serialization failures uncaught step-argument serialization failure fails the run as USER_ERROR without redelivery retries
  • error handling not registered WorkflowNotRegisteredError fails the run when workflow does not exist
  • error handling not registered StepNotRegisteredError fails the step but workflow can catch it
  • error handling not registered StepNotRegisteredError fails the run when not caught in workflow
  • hookCleanupTestWorkflow - hook token reuse after workflow completion | wrun_01M0TZBCT3E9F17RYW4SYPYX67
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01M0TZBS9F53CHXXZTXJC3SGEE
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01M0TZC6318VBM0KE349KW6RRR
  • 'hookGetConflictWithPriorStepWorkflow' - hook.getConflict() does not block step execution | wrun_01M0TZC8KPDFEW8Q8BJC0Z7X90
  • 'hookGetConflictWithParallelStepWorkfl…' - hook.getConflict() does not block step execution | wrun_01M0TZCB6GRAVN6FQ9P1F66ETE
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01M0TZCDN9MHTMAD1THHTJ7JSJ
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01M0TZCTRQGQD5TSEC1BJ5Q7T9
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01M0TZDMNRW4J42PSGDMAHWBBS
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01M0TZDR9K95QTBBK6K9DQDKK4
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01M0TZDYCMSJEA82ANRGHYR3QH
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01M0TZE2702A93V5RBTX8SM7WM
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01M0TZEB952M20J7VD2F90ZBPF
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01M0TZEJSY3WKWMGKB1GQSBQ02
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01M0TZF2P1SJREFDASAFTFZ1ER
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01M0TZFC92C46WQKPBKET3KVFM
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01M0TZFJ00P2KXYJ69YJKRDVKK
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01M0TZFM89VAFK2KSJTJHW3N8Q
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • health check (CLI) - workflow health command reports healthy endpoints
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly | wrun_01M0TZG3KY37FB4BYWQHCJANV0
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01M0TZG9H0TY1E3QS55H8J8SC5
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01M0TZGFA323VVC6Q9KB0M256N
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01M0TZGPFBEJJ30X2KSXDY618E
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01M0TZGW6VAMAZDZVFFV2NZCEY
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01M0TZH322P9V9BNQPNVJMJ0XQ
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01M0TZH9Y5V3Z1XSQXRJ7JVWCE
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01M0TZHQ1M1D4T6X42VEAD7FEG
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01M0TZJ1MR3H4DR16A5V340M96
  • cancelRun - cancelling a running workflow | wrun_01M0TZJ8QQABCME15C7VH547HP
  • cancelRun via CLI - cancelling a running workflow | wrun_01M0TZJDTM1H1V6VWWENKVBSAG
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep | wrun_01M0TZJNM23EB1AWE95BANNR94
  • hookWithSleepFinalStepWorkflow - step only on final payload | wrun_01M0TZK1DB3V212JPA9MZCKBY2
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01M0TZKAEQCH0DH0V0P5A8RQNN
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01M0TZKN21B36XCSY9YKDE6DZS
  • importMetaUrlWorkflow - import.meta.url is available in step bundles | wrun_01M0TZKW0B2D2KG78W0DKB6BT5
  • metadataFromHelperWorkflow - getWorkflowMetadata/getStepMetadata work from module-level helper (#1577) | wrun_01M0TZKY9R78NM11D32HBN875N
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01M0TZM0MTC35V26MFHZG186RV

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 99 0 8
✅ example 99 0 8
✅ express 99 0 8
✅ fastify 99 0 8
✅ hono 99 0 8
✅ nextjs-turbopack 104 0 3
✅ nextjs-webpack 104 0 3
✅ nitro 99 0 8
✅ nuxt 99 0 8
✅ sveltekit 99 0 8
✅ vite 99 0 8
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 101 0 6
✅ express-stable 101 0 6
✅ fastify-stable 101 0 6
✅ hono-stable 101 0 6
✅ nextjs-turbopack-canary 88 0 19
✅ nextjs-turbopack-stable 107 0 0
✅ nextjs-webpack-canary 88 0 19
✅ nextjs-webpack-stable 107 0 0
✅ nitro-stable 101 0 6
✅ nuxt-stable 101 0 6
✅ sveltekit-stable 101 0 6
✅ vite-stable 101 0 6
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 101 0 6
✅ express-stable 101 0 6
✅ fastify-stable 101 0 6
✅ hono-stable 101 0 6
✅ nextjs-turbopack-canary 88 0 19
✅ nextjs-turbopack-stable 107 0 0
✅ nextjs-webpack-canary 88 0 19
✅ nextjs-webpack-stable 107 0 0
✅ nitro-stable 101 0 6
✅ nuxt-stable 101 0 6
✅ sveltekit-stable 101 0 6
✅ vite-stable 101 0 6
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 101 0 6
✅ express-stable 101 0 6
✅ fastify-stable 101 0 6
✅ hono-stable 101 0 6
✅ nextjs-turbopack-canary 88 0 19
✅ nextjs-turbopack-stable 107 0 0
✅ nextjs-webpack-canary 88 0 19
✅ nextjs-webpack-stable 107 0 0
✅ nitro-stable 101 0 6
✅ nuxt-stable 101 0 6
✅ sveltekit-stable 101 0 6
✅ vite-stable 101 0 6
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 107 0 0
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 4 0 3
✅ redis-dev 4 0 3
❌ redis 68 20 0
✅ turso-dev 4 0 3
❌ turso 3 85 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 101 0 6
✅ e2e-local-dev-tanstack-start-stable 101 0 6
✅ e2e-local-postgres-nest-stable 101 0 6
✅ e2e-local-postgres-tanstack-start-stable 101 0 6
✅ e2e-local-prod-nest-stable 101 0 6
✅ e2e-local-prod-tanstack-start-stable 101 0 6

📋 View full workflow run

This branch had an error being deployed

1 failed and 17 active deployments
Preview – workflow-swc-playground — b805ffc1 Deployed Aug 24, 2026 by vercel[bot]
Preview – example-nextjs-workflow-webpack — b805ffc1 Deployed Aug 24, 2026 by vercel[bot]
Preview – example-workflow — b805ffc1 Deployed Aug 24, 2026 by vercel[bot]
Preview – example-nextjs-workflow-turbopack — b805ffc1 Deployed Aug 24, 2026 by vercel[bot]
Preview – workbench-vite-workflow — b805ffc1 Deployed Aug 24, 2026 by vercel[bot]
Preview – workbench-astro-workflow — b805ffc1 Deployed Aug 24, 2026 by vercel[bot]
Preview – workbench-sveltekit-workflow — b805ffc1 Deployed Aug 24, 2026 by vercel[bot]
Preview – workbench-tanstack-start-workflow — b805ffc1 Deployed Aug 24, 2026 by vercel[bot]
Preview – workbench-nuxt-workflow — b805ffc1 Deployed Aug 24, 2026 by vercel[bot]
Preview – workbench-hono-workflow — b805ffc1 Deployed Aug 24, 2026 by vercel[bot]
Preview – workbench-fastify-workflow — b805ffc1 Deployed Aug 24, 2026 by vercel[bot]
Preview – workbench-express-workflow — b805ffc1 Deployed Aug 24, 2026 by vercel[bot]
Preview – workbench-nitro-workflow — b805ffc1 Deployed Aug 24, 2026 by vercel[bot]
Preview – workflow-tarballs — b805ffc1 Deployed Aug 24, 2026 by vercel[bot]
Preview – workbench-nestjs-workflow — b805ffc1 Deployed Aug 24, 2026 by vercel[bot]
Preview – workflow-web — b805ffc1 Deployed Aug 24, 2026 by vercel[bot]
Preview – workflow-docs — b805ffc1 Deployed Aug 24, 2026 by vercel[bot]
Preview – workbench-python-workflow — b805ffc1 Deployed Aug 24, 2026 by vercel[bot]
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.

1 participant