Skip to content

Fix dotted tsconfig alias workflow discovery#2963

Merged
NathanColosimo merged 3 commits into
mainfrom
codex/fix-2957-dotted-alias-discovery
Jul 17, 2026
Merged

Fix dotted tsconfig alias workflow discovery#2963
NathanColosimo merged 3 commits into
mainfrom
codex/fix-2957-dotted-alias-discovery

Conversation

@NathanColosimo

@NathanColosimo NathanColosimo commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Fast discovery was checking the file extension on the unresolved import string. For an aliased import such as @/workflows/hello.index, extname() returns .index, so discovery assumed it was not a JavaScript or TypeScript file and skipped it.

The actual file is src/workflows/hello.index.ts. Because discovery skipped the import before applying the tsconfig alias and resolving the real file, the workflow implementation was omitted from the workflow bundle. The runtime still knew the workflow ID, but could not find its implementation, resulting in WorkflowNotRegisteredError.

This fixes the issue by resolving every non-builtin import first and then checking the extension of the actual resolved file. The alias now resolves to hello.index.ts, whose real extension is .ts. Node built-ins are still skipped early, and non-source assets are still excluded after resolution.

The PR also gives the existing 2,000-file @workflow/world-local streamer stress test a 30-second cleanup-hook timeout. Windows runners can exceed Vitest's default 10 seconds while deleting that fixture; the longer timeout is scoped to that test and does not change production behavior.

Validation

  • Added a regression test for a workflow reached through a dotted tsconfig alias.
  • Added a safety test proving aliased CSS assets are not scanned.
  • All 228 @workflow/builders tests pass, along with build, typecheck, Biome, changeset, and diff checks.
  • All 465 @workflow/world-local tests pass, along with package typecheck and Biome.

Fixes #2957

@changeset-bot

changeset-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 65e9288

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

This PR includes changesets to release 16 packages
Name Type
@workflow/builders Patch
@workflow/astro Patch
@workflow/cli Patch
@workflow/nest Patch
@workflow/next Patch
@workflow/nitro Patch
@workflow/nuxt Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch
@workflow/vitest Patch
workflow Patch
@workflow/world-testing Patch
@workflow/core Patch
@workflow/web-shared Patch
@workflow/web 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 16, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

📊 Workflow Benchmarks

commit 65e9288 · Fri, 17 Jul 2026 02:41:15 GMT · run logs

Backend: vercel · app: nextjs-turbopack

Metric Scenario Avg (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS stream 1275 (+17%) 1635 🔴 1680 🔴 1793 🔴 30
TTFS hook + stream 1552 (+8.6%) 1882 🔴 1926 🔴 2088 🔴 30
STSO 1020 steps (1-20) 306 (+1.4%) 331 🔴 475 🔴 530 🔴 19
STSO 1020 steps (101-120) 388 (-10%) 415 🔴 439 🔴 570 🔴 19
STSO 1020 steps (1001-1020) 932 (+8.8%) 971 🔴 1181 🔴 1821 🔴 19
WO stream 1275 (+17%) 1635 1680 1793 30
WO hook + stream 1552 (+8.6%) 1882 1926 2088 30
SL stream 3192 (-32%) 5797 🔴 5884 🔴 6111 🔴 30
SL hook + stream 4158 (-14%) 5733 🔴 5834 🔴 6002 🔴 30
📜 Previous results (2)

70a16b4

Fri, 17 Jul 2026 01:32:43 GMT · run logs

vercel / nextjs-turbopack

Metric Scenario Avg (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS stream 1295 (+19%) 1734 🔴 1780 🔴 2077 🔴 30
TTFS hook + stream 1662 (+16%) 1935 🔴 2058 🔴 2178 🔴 30
STSO 1020 steps (1-20) 272 (-9.9%) 272 🔴 464 🔴 605 🔴 19
STSO 1020 steps (101-120) 388 (-10%) 389 🔴 433 🔴 613 🔴 19
STSO 1020 steps (1001-1020) 922 (+7.6%) 987 🔴 1128 🔴 1326 🔴 19
WO stream 1295 (+19%) 1734 1780 2077 30
WO hook + stream 1662 (+16%) 1935 2058 2178 30
SL stream 3267 (-30%) 5747 🔴 5929 🔴 6971 🔴 30
SL hook + stream 4399 (-9.3%) 5818 🔴 5870 🔴 5944 🔴 30

4f04408

Thu, 16 Jul 2026 20:45:07 GMT · run logs

vercel / nextjs-turbopack

Metric Scenario Avg (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS stream 1257 (+16%) 1642 🔴 1694 🔴 2864 🔴 30
TTFS hook + stream 1647 (+15%) 1918 🔴 2114 🔴 2186 🔴 30
STSO 1020 steps (1-20) 295 (-2.4%) 317 🔴 405 🔴 447 🔴 19
STSO 1020 steps (101-120) 417 (-3.6%) 448 🔴 571 🔴 581 🔴 19
STSO 1020 steps (1001-1020) 853 (±0%) 894 🔴 994 🔴 1016 🔴 19
WO stream 1257 (+16%) 1642 1694 2864 30
WO hook + stream 1647 (+15%) 1918 2114 2186 30
SL stream 4886 (+4.4%) 5681 🔴 5792 🔴 5909 🔴 30
SL hook + stream 4859 (±0%) 5369 🔴 5643 🔴 5817 🔴 30

Avg deltas compare against the most recent benchmark run on main at the time of this run.

Metrics — TTFS: time to first step body execution · STSO: step-to-step overhead (gap between consecutive step bodies) · WO: workflow overhead (time outside step bodies, client start → last step body exit) · SL: stream latency (first chunk write → visible to the reader)

Scenarios — stream: one step that streams chunks back to the client; no hooks, so the run stays in turbo mode · hook + stream: registers a hook before the same streaming step, which exits turbo mode · 1020 steps: 1020 trivial sequential steps; STSO is measured between consecutive steps in the given step ranges

🟢/🔴 mark percentiles within/above target. Targets (p75/p90/p99, ms) — TTFS 200/300/600 · SL 50/60/125 · STSO (1-20) 20/30/60 · STSO (101-120) 30/45/90 · STSO (1001-1020) 40/60/120

TTFS/WO compare client vs deployment clocks and SL compares the step runner’s clock vs the client’s (NTP-synced in CI). WO ends at the last step body exit, the closest observable proxy for the final step-completion request.

@github-actions

github-actions Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

All tests passed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 1453 0 230 1683
✅ 💻 Local Development 1617 0 219 1836
✅ 📦 Local Production 1617 0 219 1836
✅ 🐘 Local Postgres 1617 0 219 1836
✅ 🪟 Windows 153 0 0 153
✅ 📋 Other 894 0 177 1071
✅ vercel-multi-region 27 0 0 27
Total 7378 0 1064 8442

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 126 0 27
✅ example 126 0 27
✅ express 126 0 27
✅ fastify 126 0 27
✅ hono 126 0 27
✅ nextjs-turbopack 150 0 3
✅ nextjs-webpack 150 0 3
✅ nitro 126 0 27
✅ nuxt 126 0 27
✅ sveltekit 145 0 8
✅ vite 126 0 27
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 128 0 25
✅ express-stable 128 0 25
✅ fastify-stable 128 0 25
✅ hono-stable 128 0 25
✅ nextjs-turbopack-canary 134 0 19
✅ nextjs-turbopack-stable 153 0 0
✅ nextjs-webpack-canary 134 0 19
✅ nextjs-webpack-stable 153 0 0
✅ nitro-stable 128 0 25
✅ nuxt-stable 128 0 25
✅ sveltekit-stable 147 0 6
✅ vite-stable 128 0 25
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 128 0 25
✅ express-stable 128 0 25
✅ fastify-stable 128 0 25
✅ hono-stable 128 0 25
✅ nextjs-turbopack-canary 134 0 19
✅ nextjs-turbopack-stable 153 0 0
✅ nextjs-webpack-canary 134 0 19
✅ nextjs-webpack-stable 153 0 0
✅ nitro-stable 128 0 25
✅ nuxt-stable 128 0 25
✅ sveltekit-stable 147 0 6
✅ vite-stable 128 0 25
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 128 0 25
✅ express-stable 128 0 25
✅ fastify-stable 128 0 25
✅ hono-stable 128 0 25
✅ nextjs-turbopack-canary 134 0 19
✅ nextjs-turbopack-stable 153 0 0
✅ nextjs-webpack-canary 134 0 19
✅ nextjs-webpack-stable 153 0 0
✅ nitro-stable 128 0 25
✅ nuxt-stable 128 0 25
✅ sveltekit-stable 147 0 6
✅ vite-stable 128 0 25
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 153 0 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 128 0 25
✅ e2e-local-dev-tanstack-start- 128 0 25
✅ e2e-local-postgres-nest-stable 128 0 25
✅ e2e-local-postgres-tanstack-start- 128 0 25
✅ e2e-local-prod-nest-stable 128 0 25
✅ e2e-local-prod-tanstack-start- 128 0 25
✅ e2e-vercel-prod-tanstack-start 126 0 27
✅ vercel-multi-region
App Passed Failed Skipped
✅ nextjs-turbopack 27 0 0

📋 View full workflow run

@NathanColosimo
NathanColosimo marked this pull request as ready for review July 16, 2026 23:04
@NathanColosimo
NathanColosimo requested review from a team and ijjk as code owners July 16, 2026 23:04
forceFollowImports: boolean
): Promise<void> => {
if (shouldSkipFastDiscoveryImport(specifier)) {
if (NODE_BUILTIN_SPECIFIERS.has(specifier)) {

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.

So we're now no longer matching some of the specific things above? Which includes dotted files, BUT also absolute path specifiers, which the description of this PR doesn't mention why it's safe

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

All files are still safe to resolve, we still check to see if the file is a .js or .ts file on line 939 of this file 10 lines down.

we resolve() the file before checking if its a js or ts file, which takes time, which the heuristic before was used to avoid by skipping dotted files / unknown extensions.

@NathanColosimo
NathanColosimo merged commit 927b61a into main Jul 17, 2026
104 checks passed
@NathanColosimo
NathanColosimo deleted the codex/fix-2957-dotted-alias-discovery branch July 17, 2026 05:14
github-actions Bot added a commit that referenced this pull request Jul 17, 2026
* Fix dotted alias workflow discovery

* Increase streamer stress test cleanup timeout

* Increase canary HMR rediscovery timeout

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

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2982. Merge conflicts were resolved by AI — please review carefully. (backport job 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

3 participants