Skip to content

Backport #4828: [world-vercel] Fix HTTP stream append retries after 429 - #4840

Merged
alangenfeld merged 2 commits into
stablefrom
backport/pr-4828-to-stable
Oct 13, 2026
Merged

alangenfeld merged 2 commits into
stablefrom
backport/pr-4828-to-stable

Conversation

@alangenfeld

@alangenfeld alangenfeld commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary & Motivation

stable has the same bug as #4628: on @workflow/world-vercel@4.7.7, an append retried after a 429 reuses a fetch body that was already consumed, so it fails with UND_ERR_REQ_CONTENT_LENGTH_MISMATCH. The fix is Muhammadjon Marufov's (#4828).

  • Each retry sends a new request built from saved bytes. Only confirmed 429s and failures before a connection is made get resent. Resets, timeouts and 5xx responses surface without a resend, since the append may already be saved.
  • This is adapted by hand because stable lacks main's shared throttle waiter. stable's stream writes also have a 30s per-request timeout, so the retry loop has its own wait policy. It waits only when the resend would still have half the timeout, up to 10s, before the deadline. Otherwise it surfaces the original failure instead of a timeout.
  • Retries are recorded as http.request.resend_count on the client span. Retry-After now also accepts HTTP dates.

Test Plan

Unit tests cover the retry policy, and new integration tests cover HTTP/1.1 and TLS HTTP/2. The new append tests fail on unmodified stable and pass with this change. The #4628 repro, adapted to writeToStream, fails against published 4.7.7.

I also ran it against a closed port:

  • With WORKFLOW_VERCEL_STREAM_TIMEOUT_MS=3000, it surfaces ECONNREFUSED after about 0.5s.
  • With the default 30s timeout, it surfaces ECONNREFUSED after 5 resends (about 15.5s) rather than timing out.

The full @workflow/world-vercel suite passes locally and tsc is clean.

Adapted for stable, which lacks main's shared throttle waiter: the append
retry loop carries its own bounded Retry-After wait (30s cumulative, never
past the request deadline).

Co-authored-by: Muhammadjon Marufov <marufov254@gmail.com>
Signed-off-by: Alex Langenfeld <alex.langenfeld@vercel.com>
@changeset-bot

changeset-bot Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 493716e

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

This PR includes changesets to release 17 packages
Name Type
@workflow/world-vercel Patch
@workflow/cli Patch
@workflow/core Patch
@workflow/web Patch
workflow Patch
@workflow/world-testing Patch
@workflow/builders Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/vitest Patch
@workflow/web-shared 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

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

🧪 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 86 190 9 285
✅ 📋 Other 606 0 36 642
Total 5492 190 381 6063

❌ Failed Tests

🌍 Community Worlds (190 failed)

mongodb (85 failed):

  • addTenWorkflow | wrun_01M4VCS59YN0CDHC3HRA3QXQB2
  • addTenWorkflow | wrun_01M4VCS59YN0CDHC3HRA3QXQB2
  • deploymentId: 'latest' is a no-op in non-Vercel worlds
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01M4VCTN60X5W6FRR119B0GYHF
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01M4VCSBYRYAE8QPKRPBNYFH03
  • promiseRaceWorkflow | wrun_01M4VCSF5S1DGQD8RSQB58NCX4
  • promiseAnyWorkflow | wrun_01M4VCSH5R5TTE2D5B9JPFKA4F
  • importedStepOnlyWorkflow | wrun_01M4VCV14ESJGVM9YB6A59DPP7
  • readableStreamWorkflow | wrun_01M4VCSK857WTT966C7TH6NHQB
  • hookWorkflow | wrun_01M4VCT339K8EFP170P0MVZ681
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01M4VCTACV36E7ASJJXAP1ZRYH
  • webhookWorkflow | wrun_01M4VCTFGYQTZH3FWH3FPX8RA9
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01M4VCTQ373KJ0JAK4B6XBADMQ
  • sleepingWorkflow | wrun_01M4VCVV6N4T9Z97A1FVJVSQV6
  • parallelSleepWorkflow | wrun_01M4VCWBJS7EVCXD0EVFBZP24E
  • sleepWinsRaceWorkflow | wrun_01M4VCWEZ90073RP4D4QG6ZTJ5
  • stepWinsRaceWorkflow | wrun_01M4VCWKAFWKHQKN02BHKDAF0A
  • nullByteWorkflow | wrun_01M4VCWPKAF1M4RSCRKDGGAWTJ
  • workflowAndStepMetadataWorkflow | wrun_01M4VCWRMZADRGAD3KFBZQH11P
  • 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_01M4VCZMR5WS86ATDE2QH476RG
  • writableForwardedFromWorkflowWorkflow | wrun_01M4VD03P7NZF4BQD9J8E9KMAR
  • writableForwardedFromStepWorkflow | wrun_01M4VD06PPT9Q8D3FR419K035J
  • fetchWorkflow | wrun_01M4VD09A38CN8XGHF5NC7E2QW
  • promiseRaceStressTestWorkflow | wrun_01M4VD0CKKZMZXTJWBE5WWHVFE
  • 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_01M4VD47DCJNX492WDQK85DDE6
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01M4VD4JM1SMVZS0YA3R2QQ70E
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01M4VD4YSTZ271KCYH6ESG3177
  • 'hookGetConflictWithPriorStepWorkflow' - hook.getConflict() does not block step execution | wrun_01M4VD511C3CRVDWT8MA02GSAS
  • 'hookGetConflictWithParallelStepWorkfl…' - hook.getConflict() does not block step execution | wrun_01M4VD53BWHHPYER27PD1P5RFF
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01M4VD55Z3QXKN9A60TAJAATKK
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01M4VD5KH4TCVBNHQHBV4XC158
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01M4VD6D5TZE9NKR931NTK9B32
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01M4VD6HDF3BH51XYCS58V0Q93
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01M4VD6PSZ2N3SAN6J7SFCWJJJ
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01M4VD6W4DG1ADEW40N4E8ZCXM
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01M4VD74KQW5HCG47R9WC063QB
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01M4VD7BH7SD3DX02EYXW0HA33
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01M4VD7W1RQW7GH0AGPEXA04SC
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01M4VD851Z51HQW4Q6PYYBQK6K
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01M4VD8AE4YD77ZMTMJ61BY4P6
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01M4VD8CH1BZ1H4VP7HVDCZ75J
  • 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_01M4VD8TR9PYF8YMNV4WG305YR
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01M4VD908EWB6FYN9048HVNB2T
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01M4VD974JZ87XF4MA28MCK2HT
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01M4VD9DJGD580E43QTBYFG35P
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01M4VD9M5RABQKQ5HP1354XV2C
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01M4VD9TPK6JD551RD0615X4ED
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01M4VDA195HVD787RPJ5XTP30W
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01M4VDADBDWJT2ZR2138SMD2X0
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01M4VDAN3EBSMPB0CTB0SXB7S3
  • cancelRun - cancelling a running workflow | wrun_01M4VDAVPGMTNFM58PR2VQRN47
  • cancelRun via CLI - cancelling a running workflow | wrun_01M4VDB09K3SFVFMT87F4Z1AVQ
  • 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_01M4VDB7SZAYCCKV2D3CBH852P
  • hookWithSleepFinalStepWorkflow - step only on final payload | wrun_01M4VDBKMPJ831X7NBVAB6413Z
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01M4VDBVS070CA2N83G8D20BQW
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01M4VDC8DE9YA29S3K36TYGDK0
  • importMetaUrlWorkflow - import.meta.url is available in step bundles | wrun_01M4VDCF0AAPQZTD438GK4GATD
  • metadataFromHelperWorkflow - getWorkflowMetadata/getStepMetadata work from module-level helper (#1577) | wrun_01M4VDCH7798D140CDB5QCP4J2
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01M4VDCK8P3E7ENJRRV5AZGVWN

redis (20 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01M4VCTACV36E7ASJJXAP1ZRYH
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01M4VCTQ373KJ0JAK4B6XBADMQ
  • sleepingWorkflow | wrun_01M4VCVV6N4T9Z97A1FVJVSQV6
  • 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_01M4VD4JM1SMVZS0YA3R2QQ70E
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01M4VD4YSTZ271KCYH6ESG3177
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01M4VD55Z3QXKN9A60TAJAATKK
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01M4VD5KH4TCVBNHQHBV4XC158
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01M4VD6D5TZE9NKR931NTK9B32
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01M4VD6HDF3BH51XYCS58V0Q93
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01M4VD6PSZ2N3SAN6J7SFCWJJJ
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01M4VD6W4DG1ADEW40N4E8ZCXM
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01M4VD74KQW5HCG47R9WC063QB
  • pages router sleepingWorkflow via pages router
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01M4VDCK8P3E7ENJRRV5AZGVWN

turso (85 failed):

  • addTenWorkflow | wrun_01M4VCS59YN0CDHC3HRA3QXQB2
  • addTenWorkflow | wrun_01M4VCS59YN0CDHC3HRA3QXQB2
  • deploymentId: 'latest' is a no-op in non-Vercel worlds
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01M4VCTN60X5W6FRR119B0GYHF
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01M4VCSBYRYAE8QPKRPBNYFH03
  • promiseRaceWorkflow | wrun_01M4VCSF5S1DGQD8RSQB58NCX4
  • promiseAnyWorkflow | wrun_01M4VCSH5R5TTE2D5B9JPFKA4F
  • importedStepOnlyWorkflow | wrun_01M4VCV14ESJGVM9YB6A59DPP7
  • readableStreamWorkflow | wrun_01M4VCSK857WTT966C7TH6NHQB
  • hookWorkflow | wrun_01M4VCT339K8EFP170P0MVZ681
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01M4VCTACV36E7ASJJXAP1ZRYH
  • webhookWorkflow | wrun_01M4VCTFGYQTZH3FWH3FPX8RA9
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01M4VCTQ373KJ0JAK4B6XBADMQ
  • sleepingWorkflow | wrun_01M4VCVV6N4T9Z97A1FVJVSQV6
  • parallelSleepWorkflow | wrun_01M4VCWBJS7EVCXD0EVFBZP24E
  • sleepWinsRaceWorkflow | wrun_01M4VCWEZ90073RP4D4QG6ZTJ5
  • stepWinsRaceWorkflow | wrun_01M4VCWKAFWKHQKN02BHKDAF0A
  • nullByteWorkflow | wrun_01M4VCWPKAF1M4RSCRKDGGAWTJ
  • workflowAndStepMetadataWorkflow | wrun_01M4VCWRMZADRGAD3KFBZQH11P
  • 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_01M4VCZMR5WS86ATDE2QH476RG
  • writableForwardedFromWorkflowWorkflow | wrun_01M4VD03P7NZF4BQD9J8E9KMAR
  • writableForwardedFromStepWorkflow | wrun_01M4VD06PPT9Q8D3FR419K035J
  • fetchWorkflow | wrun_01M4VD09A38CN8XGHF5NC7E2QW
  • promiseRaceStressTestWorkflow | wrun_01M4VD0CKKZMZXTJWBE5WWHVFE
  • 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_01M4VD47DCJNX492WDQK85DDE6
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01M4VD4JM1SMVZS0YA3R2QQ70E
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01M4VD4YSTZ271KCYH6ESG3177
  • 'hookGetConflictWithPriorStepWorkflow' - hook.getConflict() does not block step execution | wrun_01M4VD511C3CRVDWT8MA02GSAS
  • 'hookGetConflictWithParallelStepWorkfl…' - hook.getConflict() does not block step execution | wrun_01M4VD53BWHHPYER27PD1P5RFF
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01M4VD55Z3QXKN9A60TAJAATKK
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01M4VD5KH4TCVBNHQHBV4XC158
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01M4VD6D5TZE9NKR931NTK9B32
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01M4VD6HDF3BH51XYCS58V0Q93
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01M4VD6PSZ2N3SAN6J7SFCWJJJ
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01M4VD6W4DG1ADEW40N4E8ZCXM
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01M4VD74KQW5HCG47R9WC063QB
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01M4VD7BH7SD3DX02EYXW0HA33
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01M4VD7W1RQW7GH0AGPEXA04SC
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01M4VD851Z51HQW4Q6PYYBQK6K
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01M4VD8AE4YD77ZMTMJ61BY4P6
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01M4VD8CH1BZ1H4VP7HVDCZ75J
  • 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_01M4VD8TR9PYF8YMNV4WG305YR
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01M4VD908EWB6FYN9048HVNB2T
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01M4VD974JZ87XF4MA28MCK2HT
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01M4VD9DJGD580E43QTBYFG35P
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01M4VD9M5RABQKQ5HP1354XV2C
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01M4VD9TPK6JD551RD0615X4ED
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01M4VDA195HVD787RPJ5XTP30W
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01M4VDADBDWJT2ZR2138SMD2X0
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01M4VDAN3EBSMPB0CTB0SXB7S3
  • cancelRun - cancelling a running workflow | wrun_01M4VDAVPGMTNFM58PR2VQRN47
  • cancelRun via CLI - cancelling a running workflow | wrun_01M4VDB09K3SFVFMT87F4Z1AVQ
  • 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_01M4VDB7SZAYCCKV2D3CBH852P
  • hookWithSleepFinalStepWorkflow - step only on final payload | wrun_01M4VDBKMPJ831X7NBVAB6413Z
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01M4VDBVS070CA2N83G8D20BQW
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01M4VDC8DE9YA29S3K36TYGDK0
  • importMetaUrlWorkflow - import.meta.url is available in step bundles | wrun_01M4VDCF0AAPQZTD438GK4GATD
  • metadataFromHelperWorkflow - getWorkflowMetadata/getStepMetadata work from module-level helper (#1577) | wrun_01M4VDCH7798D140CDB5QCP4J2
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01M4VDCK8P3E7ENJRRV5AZGVWN

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
❌ mongodb 3 85 0
✅ 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

@vercel

vercel Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
example-nextjs-workflow-turbopack Ready Ready Preview, v0 Oct 13, 2026 7:46pm UTC
example-nextjs-workflow-webpack Ready Ready Preview, v0 Oct 13, 2026 7:46pm UTC
example-workflow Ready Ready Preview, v0 Oct 13, 2026 7:46pm UTC
workbench-astro-workflow Ready Ready Preview, v0 Oct 13, 2026 7:46pm UTC
workbench-express-workflow Ready Ready Preview, v0 Oct 13, 2026 7:46pm UTC
workbench-fastify-workflow Ready Ready Preview, v0 Oct 13, 2026 7:46pm UTC
workbench-hono-workflow Ready Ready Preview, v0 Oct 13, 2026 7:46pm UTC
workbench-nestjs-workflow Ready Ready Preview, v0 Oct 13, 2026 7:46pm UTC
workbench-nitro-workflow Ready Ready Preview, v0 Oct 13, 2026 7:46pm UTC
workbench-nuxt-workflow Ready Ready Preview, v0 Oct 13, 2026 7:46pm UTC
workbench-python-workflow Error Error v0 Oct 13, 2026 7:46pm UTC
workbench-sveltekit-workflow Ready Ready Preview, v0 Oct 13, 2026 7:46pm UTC
workbench-tanstack-start-workflow Ready Ready Preview, v0 Oct 13, 2026 7:46pm UTC
workbench-vite-workflow Ready Ready Preview, v0 Oct 13, 2026 7:46pm UTC
workflow-swc-playground Ready Ready Preview, v0 Oct 13, 2026 7:46pm UTC
workflow-tarballs Ready Ready Preview, v0 Oct 13, 2026 7:46pm UTC
workflow-web Ready Ready Preview, v0 Oct 13, 2026 7:46pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
workflow-docs Skipped Skipped v0 Oct 13, 2026 7:46pm UTC

@VaguelySerious VaguelySerious left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(AI) Preliminary review: AI review: no blocking issues

Comment thread packages/world-vercel/src/http-core.ts Outdated
) {
throw error;
}
await sleep(500 * 2 ** retry, signal);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Review: Note

This backoff is the one stable-specific interaction that differs from main: on main, appends run with timeoutMs: null, but on stable fetchStreamMutation passes the 30s getStreamMutationTimeoutMs() deadline. The 429 path checks that deadline before sleeping, but this sleep does not, so when the backend is unreachable the request-level AbortSignal.timeout fires during the backoff and the real cause is lost.

I checked against a closed loopback port:

  • WORKFLOW_VERCEL_STREAM_TIMEOUT_MS=30000: 6 attempts, ~15.5s, TRANSPORT ... (ECONNREFUSED). Correct.
  • WORKFLOW_VERCEL_STREAM_TIMEOUT_MS=3000: TIMEOUT ... timed out after 3001ms, and the cause is only TimeoutError: The operation was aborted due to timeout. No ECONNREFUSED anywhere in the chain.

With the default 30s, a blackholed host (undici's default 10s connect timeout) gets the same result: roughly 10s + 0.5s + 10s + 1s, then the third attempt is aborted, and the user sees "timed out after 30000ms" when no connection was ever made.

Suggestion: apply the same deadline guard here and rethrow the last connect error when Date.now() + backoff >= deadlineMs. That keeps the ECONNREFUSED/UND_ERR_CONNECT_TIMEOUT diagnosis in the surfaced error.

Comment thread packages/world-vercel/src/http-core.ts Outdated
);
if (
throttledMs + waitMs > STREAM_APPEND_THROTTLE_BUDGET_MS ||
(deadlineMs !== undefined && Date.now() + waitMs >= deadlineMs)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Review: Note

This guard stops the wait from crossing the deadline, but it puts no floor under the time left for the retried request. With the default 30s stream timeout and Retry-After: 29, the loop waits ~29s and the fresh append gets less than 1s, which is not enough for a multi-chunk page of several MB. That attempt is then aborted mid-upload, so it surfaces as TIMEOUT with an uncertain outcome (the server may have persisted it), instead of the clean, known-not-persisted 429 we would have surfaced by not waiting.

I confirmed the boundary empirically. With a 900ms deadline and Retry-After: 1, the 429 surfaces right away (1 request). With a 1200ms deadline, the loop waits 1s and retries with ~190ms left. Main's throttle waiter reserves headroom before the deadline (THROTTLE_DEADLINE_RESERVE_MS). A similar reserve here, such as only waiting when deadlineMs - (Date.now() + waitMs) still leaves a few seconds, would keep this "never makes things worse than surfacing the 429".

Comment thread packages/world-vercel/src/http-core.ts Outdated
* both the cumulative budget and the request deadline; otherwise the 429
* response is returned so the caller surfaces it.
*/
async function fetchStreamAppend(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Review: Note

The throttle half of this loop (cumulative 30s budget, 1s floor/default when Retry-After is absent, the request-deadline guard, the 5-retry cap shared between 429s and connect failures, abort during sleep) is new code that exists only on stable, because main uses its shared throttle waiter. It has the least coverage, though. stream-append-retry.test.ts only exercises Retry-After: 60 > budget, and main's policy tests in http-core.test.ts weren't ported (they target the other waiter).

I checked these by hand and they behave as intended:

  • 429 with no Retry-After: 6 requests over ~5s, then HTTP 429 surfaces.
  • Short deadline: the 429 surfaces without waiting.
  • H2 over TLS (the real allowH2 stream agent, which the PR's H1-only tests don't cover): the full body is resent for a small payload, for 4 MiB, and when the server answers 429 before reading the body.

Please add a few unit tests around fetchStreamAppend (exported for testing, or driven through instrumentedFetch with fake timers) so these limits are pinned on the 4.x line. The H2/TLS case is worth adding too, since that is the production transport.

return response;
}
throttledMs += waitMs;
console.warn(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Review: Nit

Observability. Intermediate attempts are invisible apart from this warn. Pre-connect retries log nothing, httpLog/the span only describe the final response, and the x-vercel-id/x-vercel-mitigated diagnostics of the throttled attempts are dropped when the body is cancelled. Consider including formatVercelDiagnostics(response.headers) in this warning, logging the pre-connect retries (code and backoff), and/or recording an attempt count on the span. That would let a slow append be attributed to throttling rather than latency.

}
// The append service rejects 429s before persistence, so a fresh request
// cannot duplicate the chunk.
const retryAfter = parseRetryAfter(response.headers.get('Retry-After'));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Review: Nit

Main's version of this fix also taught parseRetryAfter to accept the HTTP-date form of Retry-After. Here a date value parses to undefined and falls back to the 1s floor, so the loop retries well before the server asked it to, and the extra attempts are likely 429s too. The impact is low because it is bounded by the 5-retry cap, but porting that small parseRetryAfter change would keep the two lines consistent.

* uncertain network failures can duplicate an already-persisted append.
* The built-in append dispatcher disables retries; the SDK retries fresh
* requests above fetch for confirmed 429s and selected connection failures.
* A custom dispatcher disables that SDK append retry loop.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Review: Nit

The README's "Custom dispatcher" section (packages/world-vercel/README.md:17) still says requests "default to a shared undici RetryAgent that handles connection pooling and retries". That is no longer true for stream appends after this change. Main updated that sentence in the same fix ("use shared undici dispatchers for connection pooling"), so it is worth porting here too.

- Wait (for a 429 or a pre-connect backoff) only when the resend would still
  have half the request timeout, at most 10s, before the deadline; otherwise
  surface the 429 or rethrow the connect error instead of timing out.
- Parse HTTP-date Retry-After values, rounded up to whole seconds.
- Log pre-connect retries and the throttled attempt's x-vercel diagnostics,
  and record http.request.resend_count on the client span.
- Pin the retry policy with unit tests and cover the TLS HTTP/2 transport.
- README: dispatchers no longer retry on the append path.

Signed-off-by: Alex Langenfeld <alex.langenfeld@vercel.com>
@vercel
vercel Bot temporarily deployed to Preview – workflow-docs October 13, 2026 19:43 Inactive
@alangenfeld
alangenfeld merged commit 9fc7ee2 into stable Oct 13, 2026
95 of 99 checks passed
@alangenfeld
alangenfeld deleted the backport/pr-4828-to-stable branch October 13, 2026 20:15

This branch was previously deployed

1 inactive deployment
Preview – workflow-docs — 493716eb Deployed Oct 13, 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.

2 participants