Skip to content

Backport #3879: fix(core): re-arm late-claimed hook deliveries - #3905

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

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

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

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

AI recommendation: This is a pure correctness fix (patch changeset) for the delivery-barrier machinery in packages/core/src/private.ts, which exists verbatim on stable — including the unarmed buffered-hook barrier, the idle safety net, and the no-op arm() on an already-retired entry that lets a run suspend before a claimed hook payload reaches workflow code. The added async-deserialization-ordering regression exercises the defect through the ordinary hook API with no retained-VM machinery, so stable is exposed to the same lost/hung delivery even though the failure was found in a retained VM. Note that packages/core/src/retained-vm-loop.test.ts does not exist on stable (retained VM is main-only), so that test file should be dropped from the cherry-pick.

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

* fix(core): re-arm late-claimed hook deliveries

* refactor(core): clarify delivery barrier lifecycle

Signed-off-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9145e4a

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

@github-actions

github-actions Bot commented Aug 31, 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 82 106 9 197
✅ 📋 Other 606 0 36 642
Total 5488 106 381 5975

❌ Failed Tests

🌍 Community Worlds (106 failed)

redis (21 failed):

  • hookWorkflow | wrun_01M1CTV89F40HCCQ711TYTKD1X
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01M1CTVF3G418CEBDDP6675VZ6
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01M1CTVRZWBEG68NQFHJC8S06D
  • sleepingWorkflow | wrun_01M1CTWR4HTMJDTCW0ZVVXPSJH
  • 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_01M1CV53B15HQJBNWJMAB46EAD
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01M1CV5HBGQJCQZ6B9H2MSSJM7
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01M1CV5SFB9K6Q7VDWJKC707JD
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01M1CV674ZN48849G6CG8J278M
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01M1CV73TRW50GY0TT9WPFY1HT
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01M1CV7840A1M2Z10HPTKJPB7Z
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01M1CV7EZV8GZXC34CEVV71C2V
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01M1CV7KADCB0E96HR9KNWTQT1
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01M1CV7WF63Z20FV095ZTRKGZR
  • pages router sleepingWorkflow via pages router
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01M1CVDQQMQAJGFJE7FBPT63TT

turso (85 failed):

  • addTenWorkflow | wrun_01M1CTTA4X1RHBEBFJFP0XW290
  • addTenWorkflow | wrun_01M1CTTA4X1RHBEBFJFP0XW290
  • deploymentId: 'latest' is a no-op in non-Vercel worlds
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01M1CTTGZPYD8D1M1SGBYKYW4G
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01M1CTTHD8X5EW9HS4S9GEQ2MJ
  • promiseRaceWorkflow | wrun_01M1CTTPDYJRZ97TSZQRAZZ0VV
  • promiseAnyWorkflow | wrun_01M1CTTRYZ3ET8MCMNE56S5KQH
  • importedStepOnlyWorkflow | wrun_01M1CTTVSFNVD0333BX5GD6SHF
  • readableStreamWorkflow | wrun_01M1CTTVAHX0Q1VWPAAK0MHRPS
  • hookWorkflow | wrun_01M1CTV89F40HCCQ711TYTKD1X
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01M1CTVF3G418CEBDDP6675VZ6
  • webhookWorkflow | wrun_01M1CTVM3H0P6NBCF4RJ96CVRA
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01M1CTVRZWBEG68NQFHJC8S06D
  • sleepingWorkflow | wrun_01M1CTWR4HTMJDTCW0ZVVXPSJH
  • parallelSleepWorkflow | wrun_01M1CTX84ZAV42GM449B1FYT2R
  • sleepWinsRaceWorkflow | wrun_01M1CTXBRN6KR3AFASTKEJ67Q4
  • stepWinsRaceWorkflow | wrun_01M1CTXFEGKH62EB6F3BKTWJT2
  • nullByteWorkflow | wrun_01M1CTXJZQBKSTQE2AH6E22YSR
  • workflowAndStepMetadataWorkflow | wrun_01M1CTXNCK1NJG649SQSGWWK73
  • 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_01M1CTZY2AFJCCJ6BV61WTHTQ9
  • writableForwardedFromWorkflowWorkflow | wrun_01M1CV0AW9T5022NVPTEYZXZ4F
  • writableForwardedFromStepWorkflow | wrun_01M1CV0E0AH938BDRG6XYM46B2
  • fetchWorkflow | wrun_01M1CV0GXS83RD8JVDW34WHPMH
  • promiseRaceStressTestWorkflow | wrun_01M1CV0MDJXNKHY0YWKJ0RH1VR
  • 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_01M1CV4N8WHK9A39B0QXR4828N
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01M1CV53B15HQJBNWJMAB46EAD
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01M1CV5HBGQJCQZ6B9H2MSSJM7
  • 'hookGetConflictWithPriorStepWorkflow' - hook.getConflict() does not block step execution | wrun_01M1CV5M2JQ5JP1V95Y0XF1C60
  • 'hookGetConflictWithParallelStepWorkfl…' - hook.getConflict() does not block step execution | wrun_01M1CV5PP8TGMTASZN1FTDRPMP
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01M1CV5SFB9K6Q7VDWJKC707JD
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01M1CV674ZN48849G6CG8J278M
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01M1CV73TRW50GY0TT9WPFY1HT
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01M1CV7840A1M2Z10HPTKJPB7Z
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01M1CV7EZV8GZXC34CEVV71C2V
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01M1CV7KADCB0E96HR9KNWTQT1
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01M1CV7WF63Z20FV095ZTRKGZR
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01M1CV83N1CJ54BQ83R1EX6AFY
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01M1CV8M08DXY5819TG7RMJAT2
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01M1CV8Y7JMBH3MX1XT7HGDPVC
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01M1CV94J8GXC2XNAK6NZAGM1T
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01M1CV96WXD5N02VNRNVSE7PF4
  • 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_01M1CV9QSR19RPC42E3P96RBXN
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01M1CV9YQEY72NTQJGAR813AC5
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01M1CVA4VJ1NV5S3Q4RGD1G161
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01M1CVAAWENCXZDM9GEFEJQKD4
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01M1CVAJ6E397ZJZQSXKNEAEYW
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01M1CVASJ48AXFCJZGV5Z10EHS
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01M1CVB141FVW96K1HKNAC1PDN
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01M1CVBDFE0EFX5MS0K99WC42X
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01M1CVBNZR5XDCFMVK00JZZ5MK
  • cancelRun - cancelling a running workflow | wrun_01M1CVBXAM3Q7CWZQYM7P5MM3V
  • cancelRun via CLI - cancelling a running workflow | wrun_01M1CVC2FGT0X78QG1WPA922DH
  • 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_01M1CVCARYF6RMDW9ZB2AHWFPB
  • hookWithSleepFinalStepWorkflow - step only on final payload | wrun_01M1CVCQ3510E0FBQQQXZB7QJ3
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01M1CVD0N32V3V0AJTA45VJ4KW
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01M1CVDBM40MXAM6SDPZBCW8V0
  • importMetaUrlWorkflow - import.meta.url is available in step bundles | wrun_01M1CVDJVYDQ2BKNNQQ48DNFKD
  • metadataFromHelperWorkflow - getWorkflowMetadata/getStepMetadata work from module-level helper (#1577) | wrun_01M1CVDNA6CJH9YV3V18A902Y8
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01M1CVDQQMQAJGFJE7FBPT63TT

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 67 21 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

@pranaygp

Copy link
Copy Markdown
Contributor

closing since this only manifested in v5 in retained VM replays, but is't an issue in v4 even if it's "technically" a bug

@pranaygp pranaygp closed this Aug 31, 2026

This branch had an error being deployed

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