Skip to content

Fix namespaced active run recovery#2888

Merged
ctgowrie merged 1 commit into
mainfrom
fix/reenqueue-active-runs-queue-namespace
Jul 12, 2026
Merged

Fix namespaced active run recovery#2888
ctgowrie merged 1 commit into
mainfrom
fix/reenqueue-active-runs-queue-namespace

Conversation

@ctgowrie

@ctgowrie ctgowrie commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Description

Fix startup recovery for active workflow runs when a queue namespace is configured.

reenqueueActiveRuns now constructs workflow queue names with the shared namespace helpers instead of hardcoding __wkf_workflow_. It falls back to WORKFLOW_QUEUE_NAMESPACE, accepts an explicit namespace override, and the Postgres World passes its configured namespace through.

The local-world regression test restarts a persisted pending run with WORKFLOW_QUEUE_NAMESPACE=custom, routes it through the real namespaced createQueueHandler, and traps any accidental delivery to the unnamespaced prefix.

How did you test your changes?

  • pnpm exec vitest run packages/world/src packages/world-local/src packages/world-postgres/src — 540 tests passed
  • pnpm exec vitest run packages/world/src/recovery.test.ts packages/world-local/src/reenqueue.test.ts packages/world-postgres/src/reenqueue.test.ts — 15 focused tests passed
  • pnpm --filter @workflow/world build
  • pnpm --filter @workflow/world-local build
  • pnpm --filter @workflow/world-postgres build
  • Biome checks and git diff --check
  • pnpm changeset status --since=main

PR Checklist - Required to merge

  • 📦 pnpm changeset was run to create a changelog for this PR
  • 🔒 DCO sign-off passes (Signed-off-by included in the commit)
  • 📝 Ping @vercel/workflow in a comment once the PR is ready

Signed-off-by: Casey Gowrie <ctgowrie@gmail.com>
@ctgowrie ctgowrie requested review from a team and ijjk as code owners July 12, 2026 21:56
@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-bot Bot commented Jul 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ce557b1

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

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

@ctgowrie

Copy link
Copy Markdown
Contributor Author

@vercel/workflow This is ready for review. The changeset and DCO sign-off are included, and the affected world suites pass 540/540 tests.

@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

📊 Workflow Benchmarks

commit ce557b1 · Sun, 12 Jul 2026 22:16:31 GMT · run logs

Backend: vercel · app: nextjs-turbopack

Metric Scenario Avg (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS stream 1234 (+5.0%) 1601 🔴 1677 🔴 1849 🔴 30
TTFS hook + stream 1603 (+11%) 1965 🔴 2029 🔴 2167 🔴 30
STSO 1020 steps (1-20) 303 (+13%) 332 🔴 486 🔴 591 🔴 19
STSO 1020 steps (101-120) 381 (-9.8%) 401 🔴 465 🔴 484 🔴 19
STSO 1020 steps (1001-1020) 891 (±0%) 918 🔴 1010 🔴 1069 🔴 19
WO stream 1234 (+5.0%) 1601 1677 1849 30
WO hook + stream 1603 (+11%) 1965 2029 2167 30
SL stream 4906 (+8.9%) 5598 🔴 5702 🔴 5839 🔴 30
SL hook + stream 4843 (-0.7%) 5433 🔴 5496 🔴 6566 🔴 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 12, 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
Total 7351 0 1064 8415

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

📋 View full workflow run

@ctgowrie ctgowrie enabled auto-merge (squash) July 12, 2026 22:01
@ctgowrie ctgowrie merged commit 7a1ea5a into main Jul 12, 2026
169 of 171 checks passed
@ctgowrie ctgowrie deleted the fix/reenqueue-active-runs-queue-namespace branch July 12, 2026 22:28
github-actions Bot added a commit that referenced this pull request Jul 12, 2026
Signed-off-by: Casey Gowrie <ctgowrie@gmail.com>
Signed-off-by: Casey Gowrie <casey.gowrie@vercel.com>
@github-actions

Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2889. 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

Development

Successfully merging this pull request may close these issues.

2 participants