Skip to content

Retry failed VQS handlers immediately#1999

Merged
pranaygp merged 5 commits into
mainfrom
pranaygp/codex/immediate-vqs-handler-retry
May 15, 2026
Merged

Retry failed VQS handlers immediately#1999
pranaygp merged 5 commits into
mainfrom
pranaygp/codex/immediate-vqs-handler-retry

Conversation

@pranaygp
Copy link
Copy Markdown
Contributor

@pranaygp pranaygp commented May 14, 2026

Summary

When the Workflow queue handler throws, ask VQS to make the current message visible immediately instead of waiting for the default 300 second visibility lease to expire.

Root cause: the generated Workflow trigger config uses retryAfterSeconds: 5, but @workflow/world-vercel called QueueClient.handleCallback without a retry option. On handler failure, @vercel/queue propagated the error and the message stayed locked for the client default visibilityTimeoutSeconds: 300.

Changes

  • Pass retry: () => ({ afterSeconds: 0 }) to the VQS callback handler in @workflow/world-vercel.
  • Add a unit test asserting the retry directive is wired into handleCallback.
  • Add a patch changeset for @workflow/world-vercel.

Validation

  • git diff --check -- packages/world-vercel/src/queue.ts packages/world-vercel/src/queue.test.ts .changeset/retry-vqs-handler-errors-immediately.md
  • pnpm install with Node v24.15.0
  • pnpm --filter @workflow/utils build
  • pnpm --filter @workflow/errors build
  • pnpm --filter @workflow/world build
  • pnpm --filter @workflow/world-vercel build
  • pnpm --filter @workflow/world-vercel test -- queue.test.ts (69 tests passed)

Copilot AI review requested due to automatic review settings May 14, 2026 23:19
@pranaygp pranaygp requested a review from a team as a code owner May 14, 2026 23:19
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 14, 2026

🦋 Changeset detected

Latest commit: 45feb40

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

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

vercel Bot commented May 14, 2026

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 May 15, 2026 0:40am
example-nextjs-workflow-webpack Ready Ready Preview, Comment May 15, 2026 0:40am
example-workflow Ready Ready Preview, Comment May 15, 2026 0:40am
workbench-astro-workflow Ready Ready Preview, Comment May 15, 2026 0:40am
workbench-express-workflow Ready Ready Preview, Comment May 15, 2026 0:40am
workbench-fastify-workflow Ready Ready Preview, Comment May 15, 2026 0:40am
workbench-hono-workflow Ready Ready Preview, Comment May 15, 2026 0:40am
workbench-nitro-workflow Ready Ready Preview, Comment May 15, 2026 0:40am
workbench-nuxt-workflow Ready Ready Preview, Comment May 15, 2026 0:40am
workbench-sveltekit-workflow Ready Ready Preview, Comment May 15, 2026 0:40am
workbench-tanstack-start-workflow Ready Ready Preview, Comment May 15, 2026 0:40am
workbench-vite-workflow Ready Ready Preview, Comment May 15, 2026 0:40am
workflow-docs Ready Ready Preview, Comment, Open in v0 May 15, 2026 0:40am
workflow-swc-playground Ready Ready Preview, Comment May 15, 2026 0:40am
workflow-tarballs Ready Ready Preview, Comment May 15, 2026 0:40am
workflow-web Ready Ready Preview, Comment May 15, 2026 0:40am

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 0.025s (-44.0% 🟢) 1.004s (~) 0.979s 10 1.00x
💻 Local Nitro 0.030s (-29.7% 🟢) 1.005s (~) 0.975s 10 1.22x
🐘 Postgres Nitro 0.054s (-43.2% 🟢) 1.012s (-2.9%) 0.958s 10 2.18x
🐘 Postgres Express 0.063s (+9.3% 🔺) 1.022s (+1.1%) 0.959s 10 2.56x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 0.231s (-43.7% 🟢) 1.905s (-24.1% 🟢) 1.675s 10 1.00x
▲ Vercel Next.js (Turbopack) 0.304s (+20.9% 🔺) 2.565s (+9.9% 🔺) 2.261s 10 1.32x
▲ Vercel Express ⚠️ missing - - - -

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 1.056s (-6.2% 🟢) 2.005s (~) 0.949s 10 1.00x
💻 Local Nitro 1.065s (-5.8% 🟢) 2.006s (~) 0.941s 10 1.01x
🐘 Postgres Nitro 1.082s (-5.1% 🟢) 2.009s (~) 0.927s 10 1.02x
🐘 Postgres Express 1.086s (-5.3% 🟢) 2.009s (~) 0.923s 10 1.03x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 1.602s (-21.3% 🟢) 3.795s (-0.9%) 2.193s 10 1.00x
▲ Vercel Nitro 1.681s (-56.8% 🟢) 3.658s (-38.1% 🟢) 1.976s 10 1.05x
▲ Vercel Express ⚠️ missing - - - -

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 10.327s (-5.4% 🟢) 11.020s (~) 0.693s 3 1.00x
💻 Local Nitro 10.404s (-4.9%) 11.023s (~) 0.618s 3 1.01x
🐘 Postgres Express 10.417s (-5.0%) 11.016s (~) 0.599s 3 1.01x
🐘 Postgres Nitro 10.427s (-4.1%) 11.018s (~) 0.591s 3 1.01x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 13.713s (-42.2% 🟢) 15.652s (-37.7% 🟢) 1.939s 2 1.00x
▲ Vercel Next.js (Turbopack) 13.851s (-20.0% 🟢) 16.149s (-16.8% 🟢) 2.299s 2 1.01x
▲ Vercel Express ⚠️ missing - - - -

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 13.252s (-11.5% 🟢) 14.024s (-6.7% 🟢) 0.772s 5 1.00x
💻 Local Nitro 13.425s (-10.9% 🟢) 14.028s (-12.5% 🟢) 0.603s 5 1.01x
🐘 Postgres Nitro 13.454s (-7.8% 🟢) 14.017s (-6.7% 🟢) 0.563s 5 1.02x
🐘 Postgres Express 13.530s (-7.2% 🟢) 14.018s (-6.7% 🟢) 0.488s 5 1.02x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 21.402s (-59.3% 🟢) 23.235s (-57.5% 🟢) 1.833s 3 1.00x
▲ Vercel Nitro 21.447s (-66.7% 🟢) 23.241s (-65.1% 🟢) 1.794s 3 1.00x
▲ Vercel Express ⚠️ missing - - - -

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 50 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 11.579s (-30.3% 🟢) 12.021s (-29.4% 🟢) 0.443s 8 1.00x
💻 Local Nitro 11.845s (-29.4% 🟢) 12.024s (-29.4% 🟢) 0.179s 8 1.02x
🐘 Postgres Nitro 12.024s (-13.9% 🟢) 12.643s (-11.6% 🟢) 0.619s 8 1.04x
🐘 Postgres Express 12.057s (-13.9% 🟢) 12.516s (-14.2% 🟢) 0.459s 8 1.04x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 35.366s (-91.6% 🟢) 37.002s (-91.3% 🟢) 1.636s 3 1.00x
▲ Vercel Next.js (Turbopack) 36.089s (-90.8% 🟢) 39.185s (-90.1% 🟢) 3.096s 3 1.02x
▲ Vercel Express ⚠️ missing - - - -

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 1.135s (-23.7% 🟢) 2.005s (~) 0.870s 15 1.00x
🐘 Postgres Express 1.136s (-9.8% 🟢) 2.008s (~) 0.871s 15 1.00x
🐘 Postgres Nitro 1.145s (-10.2% 🟢) 2.007s (~) 0.862s 15 1.01x
💻 Local Nitro 1.173s (-28.1% 🟢) 2.006s (-3.3%) 0.833s 15 1.03x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.552s (-9.4% 🟢) 4.180s (-3.3%) 1.627s 8 1.00x
▲ Vercel Next.js (Turbopack) 2.792s (-17.8% 🟢) 4.564s (-7.5% 🟢) 1.772s 7 1.09x
▲ Vercel Express ⚠️ missing - - - -

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.211s (-48.7% 🟢) 2.007s (-33.3% 🟢) 0.797s 15 1.00x
🐘 Postgres Nitro 1.272s (-45.9% 🟢) 2.074s (-31.1% 🟢) 0.802s 15 1.05x
💻 Local Express 1.553s (-47.4% 🟢) 2.006s (-41.9% 🟢) 0.453s 15 1.28x
💻 Local Nitro 1.678s (-46.6% 🟢) 2.005s (-48.4% 🟢) 0.327s 15 1.39x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 4.458s (-37.2% 🟢) 6.227s (-30.1% 🟢) 1.769s 6 1.00x
▲ Vercel Nitro 5.689s (+40.4% 🔺) 7.790s (+31.6% 🔺) 2.101s 4 1.28x
▲ Vercel Express ⚠️ missing - - - -

🔍 Observability: Next.js (Turbopack) | Nitro

Promise.all with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 1.328s (-61.9% 🟢) 2.009s (-49.9% 🟢) 0.680s 15 1.00x
🐘 Postgres Nitro 1.395s (-59.9% 🟢) 2.008s (-49.9% 🟢) 0.613s 15 1.05x
💻 Local Express 3.522s (-57.8% 🟢) 4.011s (-55.6% 🟢) 0.488s 8 2.65x
💻 Local Nitro 4.447s (-46.7% 🟢) 5.011s (-44.4% 🟢) 0.564s 6 3.35x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 5.432s (+54.1% 🔺) 6.911s (+24.9% 🔺) 1.479s 5 1.00x
▲ Vercel Next.js (Turbopack) 5.852s (-34.4% 🟢) 7.738s (-29.4% 🟢) 1.886s 4 1.08x
▲ Vercel Express ⚠️ missing - - - -

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.152s (-8.4% 🟢) 2.009s (~) 0.857s 15 1.00x
🐘 Postgres Express 1.158s (-7.9% 🟢) 2.008s (~) 0.850s 15 1.01x
💻 Local Express 1.238s (-34.6% 🟢) 2.006s (-15.1% 🟢) 0.768s 15 1.07x
💻 Local Nitro 1.376s (-26.2% 🟢) 2.006s (-14.3% 🟢) 0.629s 15 1.19x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.483s (+1.0%) 3.737s (-10.4% 🟢) 1.254s 9 1.00x
▲ Vercel Next.js (Turbopack) 2.575s (-12.2% 🟢) 4.082s (-12.1% 🟢) 1.507s 8 1.04x
▲ Vercel Express ⚠️ missing - - - -

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.209s (-48.3% 🟢) 2.008s (-33.3% 🟢) 0.799s 15 1.00x
🐘 Postgres Express 1.219s (-47.9% 🟢) 2.007s (-33.3% 🟢) 0.788s 15 1.01x
💻 Local Express 1.644s (-47.5% 🟢) 2.005s (-46.7% 🟢) 0.361s 15 1.36x
💻 Local Nitro 2.046s (-33.2% 🟢) 2.469s (-36.5% 🟢) 0.423s 13 1.69x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 4.040s (+25.0% 🔺) 5.730s (+12.9% 🔺) 1.690s 6 1.00x
▲ Vercel Next.js (Turbopack) 4.073s (+29.6% 🔺) 5.712s (+26.3% 🔺) 1.638s 6 1.01x
▲ Vercel Express ⚠️ missing - - - -

🔍 Observability: Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.322s (-62.0% 🟢) 2.009s (-49.9% 🟢) 0.687s 15 1.00x
🐘 Postgres Express 1.324s (-62.2% 🟢) 2.007s (-50.0% 🟢) 0.684s 15 1.00x
💻 Local Express 4.114s (-53.3% 🟢) 4.868s (-47.5% 🟢) 0.754s 7 3.11x
💻 Local Nitro 4.825s (-47.2% 🟢) 5.345s (-46.7% 🟢) 0.520s 6 3.65x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 5.443s (+6.9% 🔺) 7.984s (+17.1% 🔺) 2.541s 4 1.00x
▲ Vercel Next.js (Turbopack) 6.066s (-10.2% 🟢) 8.119s (-5.0%) 2.054s 4 1.11x
▲ Vercel Express ⚠️ missing - - - -

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 0.443s (-46.0% 🟢) 1.007s (~) 0.564s 60 1.00x
💻 Local Express 0.448s (-54.5% 🟢) 1.003s (-6.7% 🟢) 0.556s 60 1.01x
🐘 Postgres Express 0.467s (-44.3% 🟢) 1.007s (-1.6%) 0.540s 60 1.05x
💻 Local Nitro 0.525s (-46.4% 🟢) 1.039s (-5.1% 🟢) 0.513s 58 1.19x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 4.693s (-78.7% 🟢) 6.239s (-74.0% 🟢) 1.546s 10 1.00x
▲ Vercel Next.js (Turbopack) 5.172s (-64.3% 🟢) 6.923s (-57.0% 🟢) 1.751s 9 1.10x
▲ Vercel Express ⚠️ missing - - - -

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.075s (-44.2% 🟢) 1.964s (-6.5% 🟢) 0.889s 46 1.00x
💻 Local Express 1.093s (-63.7% 🟢) 1.702s (-52.5% 🟢) 0.609s 53 1.02x
🐘 Postgres Express 1.138s (-42.4% 🟢) 2.030s (-10.1% 🟢) 0.892s 45 1.06x
💻 Local Nitro 1.159s (-61.8% 🟢) 2.006s (-46.6% 🟢) 0.847s 45 1.08x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 12.782s (-67.6% 🟢) 14.361s (-65.2% 🟢) 1.580s 7 1.00x
▲ Vercel Next.js (Turbopack) 12.891s (-74.1% 🟢) 14.919s (-71.2% 🟢) 2.027s 7 1.01x
▲ Vercel Express ⚠️ missing - - - -

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 2.211s (-46.1% 🟢) 2.865s (-37.8% 🟢) 0.654s 42 1.00x
🐘 Postgres Express 2.219s (-44.4% 🟢) 3.085s (-29.4% 🟢) 0.866s 39 1.00x
💻 Local Express 2.310s (-74.9% 🟢) 3.007s (-70.0% 🟢) 0.697s 40 1.04x
💻 Local Nitro 2.659s (-71.4% 🟢) 3.033s (-69.7% 🟢) 0.373s 40 1.20x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 41.221s (-57.5% 🟢) 43.002s (-56.3% 🟢) 1.781s 4 1.00x
▲ Vercel Next.js (Turbopack) 41.812s (-61.0% 🟢) 43.995s (-59.6% 🟢) 2.183s 3 1.01x
▲ Vercel Express ⚠️ missing - - - -

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 0.177s (-37.5% 🟢) 1.006s (~) 0.829s 60 1.00x
🐘 Postgres Express 0.178s (-37.1% 🟢) 1.006s (~) 0.829s 60 1.00x
💻 Local Express 0.376s (-32.9% 🟢) 1.003s (~) 0.627s 60 2.12x
💻 Local Nitro 0.430s (-29.0% 🟢) 1.004s (-1.7%) 0.574s 60 2.43x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.619s (+57.7% 🔺) 4.330s (+29.2% 🔺) 1.711s 14 1.00x
▲ Vercel Next.js (Turbopack) 2.972s (+46.9% 🔺) 5.256s (+38.5% 🔺) 2.284s 12 1.13x
▲ Vercel Express ⚠️ missing - - - -

🔍 Observability: Nitro | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 0.307s (-38.1% 🟢) 1.007s (~) 0.699s 90 1.00x
🐘 Postgres Express 0.311s (-39.0% 🟢) 1.014s (+0.7%) 0.702s 89 1.01x
💻 Local Express 1.849s (-26.4% 🟢) 2.252s (-25.2% 🟢) 0.402s 41 6.02x
💻 Local Nitro 2.152s (-15.2% 🟢) 2.797s (-7.1% 🟢) 0.645s 33 7.00x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 7.983s (+125.8% 🔺) 9.874s (+90.1% 🔺) 1.892s 10 1.00x
▲ Vercel Nitro 9.295s (+188.1% 🔺) 10.915s (+126.4% 🔺) 1.620s 9 1.16x
▲ Vercel Express ⚠️ missing - - - -

🔍 Observability: Next.js (Turbopack) | Nitro

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Express 0.621s (-24.1% 🟢) 1.006s (-1.1%) 0.385s 120 1.00x
🐘 Postgres Nitro 0.639s (-19.2% 🟢) 1.015s (+0.7%) 0.376s 119 1.03x
💻 Local Express 8.003s (-28.5% 🟢) 8.667s (-27.4% 🟢) 0.664s 14 12.88x
💻 Local Nitro 9.963s (-11.0% 🟢) 10.363s (-11.2% 🟢) 0.400s 12 16.04x
💻 Local Next.js (Turbopack) ⚠️ missing - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - -

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 19.990s (+158.9% 🔺) 21.905s (+133.0% 🔺) 1.915s 6 1.00x
▲ Vercel Next.js (Turbopack) 23.747s (+129.9% 🔺) 26.134s (+112.7% 🔺) 2.387s 5 1.19x
▲ Vercel Express ⚠️ missing - - - -

🔍 Observability: Nitro | Next.js (Turbopack)

Stream Benchmarks (includes TTFB metrics)
workflow with stream

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Express 1.104s (+454.5% 🔺) 2.004s (+99.5% 🔺) 0.008s (-32.2% 🟢) 2.014s (+97.9% 🔺) 0.910s 10 1.00x
💻 Local Nitro 1.131s (+429.1% 🔺) 2.005s (+99.6% 🔺) 0.010s (-18.4% 🟢) 2.017s (+98.0% 🔺) 0.887s 10 1.02x
🐘 Postgres Express 1.137s (+454.5% 🔺) 2.000s (+100.3% 🔺) 0.002s (-6.3% 🟢) 2.010s (+98.7% 🔺) 0.873s 10 1.03x
🐘 Postgres Nitro 1.145s (+458.7% 🔺) 1.999s (+100.0% 🔺) 0.001s (-20.0% 🟢) 2.010s (+98.7% 🔺) 0.864s 10 1.04x
💻 Local Next.js (Turbopack) ⚠️ missing - - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - - -

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.241s (-41.5% 🟢) 3.316s (-37.2% 🟢) 2.054s (+176.8% 🔺) 5.808s (-10.4% 🟢) 3.567s 10 1.00x
▲ Vercel Next.js (Turbopack) 2.318s (-66.2% 🟢) 3.661s (-57.7% 🟢) 2.081s (+229.3% 🔺) 6.240s (-36.3% 🟢) 3.922s 10 1.03x
▲ Vercel Express ⚠️ missing - - - - -

🔍 Observability: Nitro | Next.js (Turbopack)

stream pipeline with 5 transform steps (1MB)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Nitro 1.510s (+80.1% 🔺) 2.010s (+98.7% 🔺) 0.009s (-6.4% 🟢) 2.021s (+81.1% 🔺) 0.511s 30 1.00x
🐘 Postgres Express 1.565s (+148.5% 🔺) 2.005s (+99.2% 🔺) 0.004s (+1.8%) 2.026s (+98.1% 🔺) 0.461s 30 1.04x
🐘 Postgres Nitro 1.571s (+151.7% 🔺) 2.037s (+102.4% 🔺) 0.004s (-4.9%) 2.058s (+101.3% 🔺) 0.487s 30 1.04x
💻 Local Express 1.612s (+112.9% 🔺) 2.010s (+95.3% 🔺) 0.008s (-15.8% 🟢) 2.198s (+111.4% 🔺) 0.586s 28 1.07x
💻 Local Next.js (Turbopack) ⚠️ missing - - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - - -

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 5.811s (-65.7% 🟢) 7.125s (-60.9% 🟢) 0.250s (+18.3% 🔺) 7.983s (-57.8% 🟢) 2.171s 8 1.00x
▲ Vercel Nitro 5.976s (-79.7% 🟢) 7.199s (-76.6% 🟢) 0.202s (+80.7% 🔺) 7.811s (-75.4% 🟢) 1.835s 8 1.03x
▲ Vercel Express ⚠️ missing - - - - -

🔍 Observability: Next.js (Turbopack) | Nitro

10 parallel streams (1MB each)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 0.669s (-30.9% 🟢) 1.033s (-17.2% 🟢) 0.000s (-15.8% 🟢) 1.058s (-15.9% 🟢) 0.389s 57 1.00x
🐘 Postgres Express 0.686s (-28.6% 🟢) 1.051s (-17.8% 🟢) 0.000s (+61.4% 🔺) 1.060s (-18.9% 🟢) 0.374s 57 1.03x
💻 Local Express 1.149s (-6.2% 🟢) 1.981s (-2.0%) 0.000s (-51.6% 🟢) 1.983s (-2.0%) 0.833s 31 1.72x
💻 Local Nitro 1.338s (+9.4% 🔺) 2.016s (~) 0.000s (+33.3% 🔺) 2.018s (~) 0.680s 30 2.00x
💻 Local Next.js (Turbopack) ⚠️ missing - - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - - -

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 4.037s (-60.4% 🟢) 5.321s (-53.8% 🟢) 0.001s (+Infinity% 🔺) 5.851s (-51.4% 🟢) 1.814s 11 1.00x
▲ Vercel Nitro 4.253s (+39.4% 🔺) 5.600s (+27.5% 🔺) 0.000s (+30.0% 🔺) 6.027s (+25.3% 🔺) 1.774s 10 1.05x
▲ Vercel Express ⚠️ missing - - - - -

🔍 Observability: Next.js (Turbopack) | Nitro

fan-out fan-in 10 streams (1MB each)

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🐘 Postgres 🥇 Nitro 1.325s (-26.1% 🟢) 2.066s (-3.5%) 0.000s (-3.4%) 2.085s (-4.1%) 0.761s 29 1.00x
🐘 Postgres Express 1.389s (-21.6% 🟢) 2.103s (-3.4%) 0.000s (+Infinity% 🔺) 2.114s (-3.8%) 0.725s 29 1.05x
💻 Local Express 2.590s (-25.3% 🟢) 2.974s (-26.3% 🟢) 0.001s (-28.6% 🟢) 2.979s (-26.2% 🟢) 0.389s 21 1.96x
💻 Local Nitro 3.100s (-8.5% 🟢) 3.967s (-1.6%) 0.001s (+5.5% 🔺) 3.970s (-1.6%) 0.870s 16 2.34x
💻 Local Next.js (Turbopack) ⚠️ missing - - - - -
🐘 Postgres Next.js (Turbopack) ⚠️ missing - - - - -

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 5.450s (+33.1% 🔺) 6.924s (+28.8% 🔺) 0.000s (-100.0% 🟢) 7.361s (+27.1% 🔺) 1.912s 9 1.00x
▲ Vercel Next.js (Turbopack) 6.618s (+17.8% 🔺) 7.864s (+12.6% 🔺) 0.000s (-100.0% 🟢) 8.355s (+10.8% 🔺) 1.737s 8 1.21x
▲ Vercel Express ⚠️ missing - - - - -

🔍 Observability: Nitro | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World 🥇 Fastest Framework Wins
💻 Local Express 20/21
🐘 Postgres Nitro 14/21
▲ Vercel Nitro 15/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework 🥇 Fastest World Wins
Express 🐘 Postgres 12/21
Next.js (Turbopack) ▲ Vercel 21/21
Nitro 🐘 Postgres 14/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 14, 2026

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
❌ ▲ Vercel Production 1196 4 219 1419
✅ 💻 Local Development 1587 0 219 1806
✅ 📦 Local Production 1587 0 219 1806
❌ 🐘 Local Postgres 1586 1 219 1806
✅ 🪟 Windows 129 0 0 129
✅ 📋 Other 727 0 176 903
Total 6812 5 1052 7869

❌ Failed Tests

▲ Vercel Production (4 failed)

astro (1 failed):

  • AbortController abortAnyInStepWorkflow: AbortSignal.any inside a step composes deserialized signals

express (1 failed):

  • AbortController abortDeterministicBranchFromStepWorkflow: branches stay consistent when abort comes from a step

nuxt (1 failed):

  • runClassSerializationWorkflow - Run instances serialize across workflow/step boundaries | wrun_01KRMHFSCJH1N8FQ7XV2Z0EYWG | 🔍 observability

vite (1 failed):

  • fibonacciWorkflow - recursive workflow composition via start() | wrun_01KRMHG8R8XFT3RMXVQ70JM22A | 🔍 observability
🐘 Local Postgres (1 failed)

nextjs-webpack-stable-lazy-discovery-disabled (1 failed):

  • addTenWorkflow | wrun_01KRMH3MTK3F9C2E3XSFN0VC5C

Details by Category

❌ ▲ Vercel Production
App Passed Failed Skipped
❌ astro 102 1 26
✅ example 103 0 26
❌ express 102 1 26
✅ fastify 103 0 26
✅ hono 103 0 26
✅ nextjs-turbopack 127 0 2
✅ nextjs-webpack 127 0 2
✅ nitro 103 0 26
❌ nuxt 102 1 26
✅ sveltekit 122 0 7
❌ vite 102 1 26
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 104 0 25
✅ express-stable 104 0 25
✅ fastify-stable 104 0 25
✅ hono-stable 104 0 25
✅ nextjs-turbopack-canary 110 0 19
✅ nextjs-turbopack-stable-lazy-discovery-disabled 129 0 0
✅ nextjs-turbopack-stable-lazy-discovery-enabled 129 0 0
✅ nextjs-webpack-canary 110 0 19
✅ nextjs-webpack-stable-lazy-discovery-disabled 129 0 0
✅ nextjs-webpack-stable-lazy-discovery-enabled 129 0 0
✅ nitro-stable 104 0 25
✅ nuxt-stable 104 0 25
✅ sveltekit-stable 123 0 6
✅ vite-stable 104 0 25
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 104 0 25
✅ express-stable 104 0 25
✅ fastify-stable 104 0 25
✅ hono-stable 104 0 25
✅ nextjs-turbopack-canary 110 0 19
✅ nextjs-turbopack-stable-lazy-discovery-disabled 129 0 0
✅ nextjs-turbopack-stable-lazy-discovery-enabled 129 0 0
✅ nextjs-webpack-canary 110 0 19
✅ nextjs-webpack-stable-lazy-discovery-disabled 129 0 0
✅ nextjs-webpack-stable-lazy-discovery-enabled 129 0 0
✅ nitro-stable 104 0 25
✅ nuxt-stable 104 0 25
✅ sveltekit-stable 123 0 6
✅ vite-stable 104 0 25
❌ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 104 0 25
✅ express-stable 104 0 25
✅ fastify-stable 104 0 25
✅ hono-stable 104 0 25
✅ nextjs-turbopack-canary 110 0 19
✅ nextjs-turbopack-stable-lazy-discovery-disabled 129 0 0
✅ nextjs-turbopack-stable-lazy-discovery-enabled 129 0 0
✅ nextjs-webpack-canary 110 0 19
❌ nextjs-webpack-stable-lazy-discovery-disabled 128 1 0
✅ nextjs-webpack-stable-lazy-discovery-enabled 129 0 0
✅ nitro-stable 104 0 25
✅ nuxt-stable 104 0 25
✅ sveltekit-stable 123 0 6
✅ vite-stable 104 0 25
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 129 0 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 104 0 25
✅ e2e-local-dev-tanstack-start- 104 0 25
✅ e2e-local-postgres-nest-stable 104 0 25
✅ e2e-local-postgres-tanstack-start- 104 0 25
✅ e2e-local-prod-nest-stable 104 0 25
✅ e2e-local-prod-tanstack-start- 104 0 25
✅ e2e-vercel-prod-tanstack-start 103 0 26

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: failure
  • Windows: success

Check the workflow run for details.

Comment thread packages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),
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.

Add a comment please

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.

Done in c0a0ea35f / 107c5cbee: added a block comment explaining the 300s VQS visibility-timeout default, why we pass an explicit retry directive, and the idempotency expectation for close-together retries.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates @workflow/world-vercel queue handling so failed VQS workflow handler invocations request an immediate retry directive instead of relying on the default visibility timeout.

Changes:

  • Adds a retry option to QueueClient.handleCallback.
  • Updates unit coverage for the callback retry option.
  • Adds a patch changeset for @workflow/world-vercel.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
packages/world-vercel/src/queue.ts Wires retry options into the VQS callback handler.
packages/world-vercel/src/queue.test.ts Adds/updates assertions for handleCallback retry behavior.
.changeset/retry-vqs-handler-errors-immediately.md Adds release metadata for the world-vercel patch.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .changeset/retry-vqs-handler-errors-immediately.md Outdated
Comment on lines +294 to 296
{
retry: () => ({ afterSeconds: 0 }),
}
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.

Updated in 107c5cbee: this no longer forces afterSeconds: 0. Handler failures now use delivery-count backoff starting at 1s and capped at 60s, so retries are quick without burning the delivery budget in a tight loop.

Comment thread packages/world-vercel/src/queue.test.ts Outdated
Comment on lines +368 to +373
expect(
options.retry(new Error('workflow server unavailable'), {
messageId: 'msg-123',
deliveryCount: 1,
})
).toEqual({ afterSeconds: 0 });
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.

Updated in 107c5cbee: the test now asserts the bounded retry sequence instead of { afterSeconds: 0 }.

Copy link
Copy Markdown
Contributor

@karthikscale3 karthikscale3 left a comment

Choose a reason for hiding this comment

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

Diagnosis is right — confirmed independently from staging Datadog logs that the 300s gap is the @vercel/queue default visibilityTimeoutSeconds. Fix wires the right API surface, but afterSeconds: 0 overcorrects in a few ways. Inline comments cover them. Worth pairing with a workflow-server-side change that maps getaddrinfo EBUSY / transient AWS SDK errors to 503 Retry-After: 1 so the SDK can retry without ever bouncing back to the queue.

Comment thread packages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

afterSeconds: 0 overrides the configured retryAfterSeconds: 5.

Per the @vercel/queue README: "the message is re-delivered after the configured retry delay (from retryAfterSeconds in vercel.json or the retry callback's afterSeconds)". So returning 0 here bypasses the trigger-config value the SDK already generates.

For the concrete bug that motivated this (DNS EBUSY on a Fluid Compute lambda whose libuv DNS thread pool was wedged for ~9s), a 0s retry will land back on the same wedged container before it recycles. The configured 5s would actually be the right floor.

Suggest: retry: () => ({ afterSeconds: 5 }) to match retryAfterSeconds in the generated trigger config, or read the value from a shared constant so they can't drift apart.

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.

5 seconds seems too long still. where is that floor coming from?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is a good point about the interaction between afterSeconds in the retry callback and the retryAfterSeconds: 5 in the trigger config.

However, looking at the handler-side code in packages/core/src/runtime.ts (line 158) and packages/core/src/runtime/step-handler.ts (line 98), runs/steps are bounded at MAX_QUEUE_DELIVERIES = 48 attempts — the handler will gracefully fail the run before unbounded looping occurs. The comment in constants.ts does note the 48-attempt budget was sized assuming ~20 hours of elapsed time with the 5s backoff schedule, so with afterSeconds: 0 those 48 attempts would exhaust much faster.

That said, the main fix here (avoiding the 300s visibility lock) is clearly correct. The question is whether afterSeconds: 0 vs something like afterSeconds: 5 matters in practice — @pranaygp would know best whether VQS applies its own backoff on top of the afterSeconds value from the retry callback or if this truly replaces the entire schedule.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good catch. I agree that afterSeconds: 0 is more aggressive than needed. The retryAfterSeconds: 5 in the trigger config (also defined in packages/builders/src/constants.ts as WORKFLOW_QUEUE_TRIGGER.retryAfterSeconds) exists for a reason, and the retry callback's afterSeconds overrides it entirely.

The suggestion to use afterSeconds: 5 (or better, import from the shared WORKFLOW_QUEUE_TRIGGER constant) makes sense — it fixes the 300s visibility timeout problem while preserving the backoff floor that MAX_QUEUE_DELIVERIES = 48 was sized around.

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.

Adjusted in 107c5cbee after Pranay’s follow-up: instead of a 5s floor, the retry starts at 1s and then backs off by delivery count. That keeps the first retry quick while avoiding the original 0s hot-loop risk.

Comment thread packages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No deliveryCount-aware backoff — poison messages will hot-loop.

This returns 0 for every delivery. For a permanently-broken message (malformed payload, schema mismatch, a workflow-server 500 that isn't transient), VQS will redeliver every ~0s until it hits its max-receive limit / DLQ. That's much hotter than the current 300s behavior.

Standard shape that handles both transient and stuck without classification:

retry: (_err, { deliveryCount }) => ({
  afterSeconds: Math.min(2 ** (deliveryCount - 1), 60),
})

Gives 1s → 2s → 4s → 8s … capped at 60s. Fast enough for transient (full recovery within seconds), gentle enough not to thrash on a poison message.

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.

Implemented in 107c5cbee: handler errors now use delivery-count-aware backoff (1s -> 2s -> 4s -> 8s ...) capped at 60s.

Comment thread packages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cross-system amplification risk during a workflow-server outage.

The 300s default is bad for happy-path latency but accidentally acts as a circuit-breaker when workflow-server is browning out — each in-flight message is held off-line for 5 min, naturally throttling redrive volume. With afterSeconds: 0, every dispatched VQS message will thrash workflow-server at full speed during exactly the situations we'd want to be gentle on.

The deliveryCount-aware backoff in my other comment addresses this too — once retries pile up, the per-message redrive rate self-throttles via exponential backoff.

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.

Addressed by the same backoff in 107c5cbee: repeated failures self-throttle up to a 60s cap instead of hammering workflow-server with 0s redrives.

Comment thread packages/world-vercel/src/queue.ts Outdated
}
},
{
retry: () => ({ afterSeconds: 0 }),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Worth a comment here explaining why this retry handler exists.

Future readers will see retry: () => ({ afterSeconds: 0 }) and wonder why we explicitly opt into a non-default. A short block comment naming the 300s visibilityTimeoutSeconds default and the incident that motivated it (or the linked PR / issue) would make this durable. Without it, the next person to touch this is likely to remove it as redundant.

Also worth a one-line note that workflow/step handlers must be idempotent — the event-sourced model already required this for the 300s replay path, but tightening the redrive window makes back-to-back replays much more likely in practice.

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.

Done in c0a0ea35f / 107c5cbee: added the explanatory comment and called out the idempotency requirement.

Comment thread packages/world-vercel/src/queue.test.ts Outdated
messageId: 'msg-123',
deliveryCount: 1,
})
).toEqual({ afterSeconds: 0 });
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Test asserts the directive shape but not the contract.

This invokes options.retry directly with a stubbed error, which verifies the function we pass in returns the right thing — but it doesn't exercise the path where @vercel/queue actually calls retry on a real handler throw. If handleCallback's contract for retry ever changes (different metadata shape, different return-type, called/not-called timing), this test still passes.

A small integration-style test using a real QueueClient with a throwing handler, then asserting redelivery happened with the expected delay, would catch contract drift. Not blocking — @vercel/queue owns the other side — but worth considering as a follow-up.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The test validates the contract that the production code passes to @vercel/queue — i.e., the retry callback shape and return value. Testing the actual handleCallback integration would require either not mocking @vercel/queue or a more complex integration test, which seems out of scope for a unit test. The mock-based approach here is consistent with how other handleCallback behavior is tested in this file (e.g., the existing mockHandleCallback pattern).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Agree this is fine for now — it verifies the wiring correctly. An integration test with a real QueueClient would be more robust against contract drift but isn't blocking for this change.

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.

Leaving the real @vercel/queue contract test as a follow-up since that side is owned by the queue package. This PR now covers the world-vercel retry directive and the backoff values it returns.

Copy link
Copy Markdown
Contributor

@ctgowrie ctgowrie left a comment

Choose a reason for hiding this comment

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

I don't think this will work. The problem is that we claim the message for 5 minutes. So even if we retry immediately, we will fail to claim the message.

Actually, this is a new message. We probably want some sort of backoff here, so we don't hammer the consumer. Lets discuss in slack

Comment thread packages/world-vercel/src/queue.ts Outdated
Comment on lines +305 to +310
// Without an explicit retry directive, @vercel/queue leaves failed
// handler messages invisible until the default 300s visibility timeout
// expires. Start retrying quickly, then back off by delivery count so
// an outage or poison message cannot hot-loop. Workflow handlers are
// event-sourced and must remain idempotent because queue retries can
// happen close together.
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.

shouldn't VQS fallback to the configured 5s retryAfter configured in the config when nothing is explicitly set, instead of 300s visibility timeout?

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.

Checked against the @vercel/queue callback path in ~/github/vercel/vqs: the handler creates a consumer group with visibilityTimeoutSeconds defaulting to 300, and on handler throw it only calls changeVisibility when the retry callback returns { afterSeconds }. If the retry callback is absent/undefined, the error propagates and the message stays hidden until that visibility timeout expires. So this path does not appear to fall back to the trigger config’s retryAfterSeconds: 5; that matches the observed 300s retry delay and is why this PR keeps an explicit retry directive.

@pranaygp pranaygp enabled auto-merge (squash) May 15, 2026 00:36
@pranaygp pranaygp disabled auto-merge May 15, 2026 20:17
@pranaygp pranaygp merged commit c43e721 into main May 15, 2026
113 of 120 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Backport PR opened against stable: #2007.

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.

5 participants