Skip to content

Backport #2996: perf(core): cache port discovery for step invocations#2997

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

Backport #2996: perf(core): cache port discovery for step invocations#2997
github-actions[bot] wants to merge 1 commit into
stablefrom
backport/pr-2996-to-stable

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

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

AI recommendation: This is a self-contained performance fix that reuses the existing getPortLazy() cache (already present on stable) for step invocations, replacing the same isVercel ? undefined : getPort() pattern that exists verbatim on stable. All changed files and required testing helpers (resetPortCacheForTesting, setPortResolverForTesting) already exist on stable, so it applies cleanly without depending on any main-only behavior.

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

…worlds (#2996)

Signed-off-by: Joey Hotz <joeyhotz1@gmail.com>
@changeset-bot

changeset-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 44fe3ea

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 Jul 18, 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, Comment Jul 18, 2026 4:56pm
example-nextjs-workflow-webpack Ready Ready Preview, Comment Jul 18, 2026 4:56pm
example-workflow Ready Ready Preview, Comment Jul 18, 2026 4:56pm
workbench-astro-workflow Ready Ready Preview, Comment Jul 18, 2026 4:56pm
workbench-express-workflow Ready Ready Preview, Comment Jul 18, 2026 4:56pm
workbench-fastify-workflow Ready Ready Preview, Comment Jul 18, 2026 4:56pm
workbench-hono-workflow Ready Ready Preview, Comment Jul 18, 2026 4:56pm
workbench-nitro-workflow Ready Ready Preview, Comment Jul 18, 2026 4:56pm
workbench-nuxt-workflow Ready Ready Preview, Comment Jul 18, 2026 4:56pm
workbench-sveltekit-workflow Ready Ready Preview, Comment Jul 18, 2026 4:56pm
workbench-tanstack-start-workflow Ready Ready Preview, Comment Jul 18, 2026 4:56pm
workbench-vite-workflow Ready Ready Preview, Comment Jul 18, 2026 4:56pm
workflow-docs Ready Ready Preview, Comment, Open in v0 Jul 18, 2026 4:56pm
workflow-swc-playground Ready Ready Preview, Comment Jul 18, 2026 4:56pm
workflow-tarballs Ready Ready Preview, Comment Jul 18, 2026 4:56pm
workflow-web Ready Ready Preview, Comment Jul 18, 2026 4:56pm

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 1077 0 78 1155
✅ 💻 Local Development 1174 0 86 1260
✅ 📦 Local Production 1174 0 86 1260
✅ 🐘 Local Postgres 1174 0 86 1260
✅ 🪟 Windows 105 0 0 105
❌ 🌍 Community Worlds 82 102 9 193
✅ 📋 Other 594 0 36 630
Total 5380 102 381 5863

❌ Failed Tests

🌍 Community Worlds (102 failed)

redis (19 failed):

  • hookWorkflow | wrun_01KXV4KPFQ8NCRRNNCEYW6J22T
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KXV4KXNBHRB2JYPPM23608ZX
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01KXV4M9GT0SE1CTG916HNV756
  • sleepingWorkflow | wrun_01KXV4NAEZ269N5RJ6HPNJ642G
  • 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
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KXV4WZ13NYM3DQ8HCZB52HBD
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01KXV4XAV2YSV4WFTQTS1QKCMM
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01KXV4XJ57E46P44C7JBZ23K4Q
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01KXV4XYZXXFA7T73FDP7NDQFA
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01KXV4YRF74183HZAB6FGZ36SK
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01KXV4YWYDMVR9D380CCTSGGRX
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01KXV4Z21557QFWAC7PAWF1Z0H
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01KXV4Z6YVS877A77ZA0HPPH02
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01KXV4ZFYVY1Z5359761K8NHVM
  • pages router sleepingWorkflow via pages router
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01KXV54Y6XF9E7RXCG0DEPDA5Z

turso (83 failed):

  • addTenWorkflow | wrun_01KXV4JQC6VERDH0ZNYQWTP2YD
  • addTenWorkflow | wrun_01KXV4JQC6VERDH0ZNYQWTP2YD
  • deploymentId: 'latest' is a no-op in non-Vercel worlds
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KXV4JY9WW08QDT97V083CAF4
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KXV4JZ4028AVAYHZG0H84955
  • promiseRaceWorkflow | wrun_01KXV4K3ENWT6HHSDAA0H84MJ0
  • promiseAnyWorkflow | wrun_01KXV4K5MA289RQ0D26Q83PV2C
  • importedStepOnlyWorkflow | wrun_01KXV4KBFP88F9R1FZ3HP0QBQC
  • readableStreamWorkflow | wrun_01KXV4K7PA7Q360VCHKF1X49G4
  • hookWorkflow | wrun_01KXV4KPFQ8NCRRNNCEYW6J22T
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KXV4KXNBHRB2JYPPM23608ZX
  • webhookWorkflow | wrun_01KXV4M2X4W5VMFMBWTY3QXNB2
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01KXV4M9GT0SE1CTG916HNV756
  • sleepingWorkflow | wrun_01KXV4NAEZ269N5RJ6HPNJ642G
  • parallelSleepWorkflow | wrun_01KXV4NSHQ3B2KGA28YS9SNDGM
  • sleepWinsRaceWorkflow | wrun_01KXV4NXW21D1M89VDM5M0ES95
  • stepWinsRaceWorkflow | wrun_01KXV4P19191GZSZKZ4ARKM9QX
  • nullByteWorkflow | wrun_01KXV4P5NM0WWPDBMW9HW2380B
  • workflowAndStepMetadataWorkflow | wrun_01KXV4P7Q65P9XV6JZ000W0NV5
  • 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_01KXV4RFN8E1E0ERGZY4VR1CSH
  • writableForwardedFromWorkflowWorkflow | wrun_01KXV4RY4QMR36RVVHJH9SFGGH
  • writableForwardedFromStepWorkflow | wrun_01KXV4S28MWVXXG4BG2V67D3XE
  • fetchWorkflow | wrun_01KXV4S5KJ877KAR3YD1EBZ370
  • promiseRaceStressTestWorkflow | wrun_01KXV4S8RZN6RNA322HFBZR7TR
  • 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 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_01KXV4WKNXNENNJJTX1AYG72HG
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KXV4WZ13NYM3DQ8HCZB52HBD
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01KXV4XAV2YSV4WFTQTS1QKCMM
  • 'hookGetConflictWithPriorStepWorkflow' - hook.getConflict() does not block step execution | wrun_01KXV4XD92VPSMMZ89D9R3TWQC
  • 'hookGetConflictWithParallelStepWorkfl…' - hook.getConflict() does not block step execution | wrun_01KXV4XFR4SV2X7HDKYZ0YKQQG
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01KXV4XJ57E46P44C7JBZ23K4Q
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01KXV4XYZXXFA7T73FDP7NDQFA
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01KXV4YRF74183HZAB6FGZ36SK
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01KXV4YWYDMVR9D380CCTSGGRX
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01KXV4Z21557QFWAC7PAWF1Z0H
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01KXV4Z6YVS877A77ZA0HPPH02
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01KXV4ZFYVY1Z5359761K8NHVM
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KXV4ZQQ7FWE9Z2Q3WSW64D0H
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KXV507BNJPKY9X427SECQDKJ
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KXV50G6PV4ZMG73FH78KQ33M
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KXV50NENWKJ1F4V110W5752B
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KXV50QNX243EYYG1KDTD2GXV
  • 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_01KXV5177BC0GNRZX95VP9K793
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KXV51CTEZFKDVMRW92MMJ6HM
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KXV51KDAMC3MR2D8Q3XMF36D
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KXV51S4M9JRCDXYXKV1SGVA2
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KXV51ZTQXK5Y2SABWQDTH82E
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KXV526MN5ZR1XPHY1NJND5FH
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KXV52DCEF63X83372RBFTS4M
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KXV52SKMMHG6E468K7VFKKN7
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KXV532JCA45JE1EF5KYBG0AA
  • cancelRun - cancelling a running workflow | wrun_01KXV53933VXZY63MF561ZAS6P
  • cancelRun via CLI - cancelling a running workflow | wrun_01KXV53DT5R2CT8KNEFKEJ65GN
  • 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_01KXV53NB7ZR55WGQDB2ZQ3FW3
  • hookWithSleepFinalStepWorkflow - step only on final payload | wrun_01KXV540TAGJ9A1V8SDK6Q2RFK
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KXV5493QH75DXYF55GFJ4Z44
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KXV54K7V89RY8QX62AF1Q5GT
  • importMetaUrlWorkflow - import.meta.url is available in step bundles | wrun_01KXV54SRH72B9DG13Y0KHV377
  • metadataFromHelperWorkflow - getWorkflowMetadata/getStepMetadata work from module-level helper (#1577) | wrun_01KXV54VYBFG02R3T1HGZKPYSJ
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01KXV54Y6XF9E7RXCG0DEPDA5Z

Details by Category

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

📋 View full workflow run

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