Skip to content

DurableAgent: various compatibility fixes - #1385

Merged
VaguelySerious merged 18 commits into
mainfrom
peter/combined-durable-agent-fixes
Mar 17, 2026
Merged

DurableAgent: various compatibility fixes#1385
VaguelySerious merged 18 commits into
mainfrom
peter/combined-durable-agent-fixes

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 14, 2026

Copy link
Copy Markdown
Member

Closes#1303 : Support prepareStep on DurableAgent constructor with stream-level override
Closes#1302 : Add InferDurableAgentTools and InferDurableAgentUIMessage type helpers
Closes#1376 : Fix AI_DownloadError for image URLs by defaulting to no-op download
Closes#1296 : Add telemetry span support (ai.streamText.doStream, ai.toolCall) via optional @opentelemetry/api
Closes#848: Allow LanguageModelV3ToolResultOutput results to pass through without json parsin
Closes#975: Documents the necessity of sendStart: false when writing custom UIMessageChunks

Co-Authored-By: @nicoalbanese

… fix, telemetry spans
- Add InferDurableAgentTools and InferDurableAgentUIMessage type helpers (#1302)
- Support prepareStep on DurableAgent constructor with stream-level override (#1303)
- Fix AI_DownloadError for image URLs by defaulting to no-op download (#1376)
- Add telemetry span support (ai.streamText.doStream, ai.toolCall) via optional @opentelemetry/api (#1296)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@VaguelySerious
VaguelySerious requested a review from a team as a code ownerMarch 14, 2026 00:18
@changeset-bot

changeset-botBot commented Mar 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 094fe61

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

This PR includes changesets to release 1 package
NameType
@workflow/aiPatch

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

vercelBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production747067814
✅ 💻 Local Development7700118888
✅ 📦 Local Production7700118888
✅ 🐘 Local Postgres7700118888
✅ 🪟 Windows710374
❌ 🌍 Community Worlds1165515186
✅ 📋 Other195027222
Total3439554663960

❌ Failed Tests

🌍 Community Worlds (55 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

turso (50 failed):

  • addTenWorkflow
  • addTenWorkflow
  • wellKnownAgentWorkflow (.well-known/agent)
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • importedStepOnlyWorkflow
  • hookWorkflow
  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • 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()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • 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
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control)

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6707
✅ example6707
✅ express6707
✅ fastify6707
✅ hono6707
✅ nextjs-turbopack7202
✅ nextjs-webpack7202
✅ nitro6707
✅ nuxt6707
✅ sveltekit6707
✅ vite6707
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7103
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5133
✅ redis-dev302
❌ redis5223
✅ turso-dev302
❌ turso4503
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6509
✅ e2e-local-postgres-nest-stable6509
✅ e2e-local-prod-nest-stable6509

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.039s (-8.7% 🟢)1.006s (~)0.967s101.00x
💻 LocalExpress0.046s (+2.0%)1.005s (-2.0%)0.960s101.18x
💻 LocalNext.js (Turbopack)0.049s1.005s0.956s101.27x
🌐 RedisNext.js (Turbopack)0.054s1.005s0.952s101.39x
🐘 PostgresNext.js (Turbopack)0.061s1.011s0.950s101.57x
🐘 PostgresExpress0.063s (-1.1%)1.012s (~)0.949s101.62x
🐘 PostgresNitro0.067s (+7.7% 🔺)1.017s (+0.5%)0.950s101.74x
🌐 MongoDBNext.js (Turbopack)0.132s1.007s0.876s103.40x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.432s (-54.7% 🟢)2.416s (-18.6% 🟢)1.985s101.00x
▲ VercelExpress0.473s (+1.2%)2.454s (-10.0% 🟢)1.980s101.10x
▲ VercelNitro0.486s (-28.1% 🟢)2.572s (+3.6%)2.085s101.13x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.097s (-2.4%)2.006s (~)0.909s101.00x
💻 LocalNext.js (Turbopack)1.116s2.005s0.889s101.02x
🌐 RedisNext.js (Turbopack)1.132s2.007s0.875s101.03x
💻 LocalExpress1.135s (+1.0%)2.007s (~)0.871s101.04x
🐘 PostgresNext.js (Turbopack)1.146s2.012s0.866s101.05x
🐘 PostgresExpress1.146s (~)2.011s (~)0.865s101.05x
🐘 PostgresNitro1.147s (~)2.013s (~)0.865s101.05x
🌐 MongoDBNext.js (Turbopack)1.306s2.009s0.703s101.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.024s (-5.8% 🟢)3.561s (-6.7% 🟢)1.537s101.00x
▲ VercelExpress2.054s (-1.0%)3.521s (-3.3%)1.467s101.01x
▲ VercelNitro2.169s (-16.8% 🟢)3.862s (-17.8% 🟢)1.693s101.07x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.630s (-2.5%)11.024s (~)0.394s31.00x
💻 LocalNext.js (Turbopack)10.802s11.023s0.221s31.02x
🌐 RedisNext.js (Turbopack)10.812s11.023s0.211s31.02x
🐘 PostgresNext.js (Turbopack)10.836s11.037s0.202s31.02x
💻 LocalExpress10.902s (~)11.024s (~)0.122s31.03x
🐘 PostgresExpress10.932s (~)11.038s (~)0.106s31.03x
🐘 PostgresNitro10.939s (~)11.039s (~)0.100s31.03x
🌐 MongoDBNext.js (Turbopack)12.271s13.022s0.751s31.15x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express16.422s (-3.1%)17.403s (-4.7%)0.981s21.00x
▲ VercelNitro16.722s (-4.4%)18.741s (-7.7% 🟢)2.019s21.02x
▲ VercelNext.js (Turbopack)18.961s (+8.2% 🔺)20.762s (+8.0% 🔺)1.801s21.15x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro26.775s (-2.5%)27.053s (-3.6%)0.278s31.00x
🌐 RedisNext.js (Turbopack)26.787s27.052s0.265s31.00x
🐘 PostgresNext.js (Turbopack)27.016s27.395s0.379s31.01x
🐘 PostgresExpress27.132s (~)27.727s (-1.2%)0.595s31.01x
🐘 PostgresNitro27.235s (~)28.063s (~)0.828s31.02x
💻 LocalNext.js (Turbopack)27.255s28.054s0.799s31.02x
💻 LocalExpress27.513s (~)28.053s (~)0.540s31.03x
🌐 MongoDBNext.js (Turbopack)30.389s31.037s0.649s21.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)45.154s (+2.7%)47.613s (+2.5%)2.459s21.00x
▲ VercelExpress45.218s (+3.1%)46.945s (+2.1%)1.727s21.00x
▲ VercelNitro45.293s (+4.1%)46.791s (+2.7%)1.498s21.00x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)53.414s54.097s0.683s21.00x
🐘 PostgresNext.js (Turbopack)53.876s54.094s0.218s21.01x
🐘 PostgresNitro54.282s (~)55.097s (~)0.815s21.02x
🐘 PostgresExpress54.301s (~)55.100s (~)0.799s21.02x
💻 LocalNitro54.970s (-3.0%)55.107s (-3.5%)0.137s21.03x
💻 LocalNext.js (Turbopack)55.942s56.100s0.158s21.05x
💻 LocalExpress56.868s (~)57.102s (~)0.234s21.06x
🌐 MongoDBNext.js (Turbopack)60.595s61.067s0.472s21.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)93.323s (-3.2%)94.121s (-4.5%)0.798s11.00x
▲ VercelExpress94.753s (+2.1%)97.186s (+3.1%)2.433s11.02x
▲ VercelNitro97.185s (+1.5%)98.493s (+0.6%)1.308s11.04x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.395s2.006s0.612s151.00x
🐘 PostgresNitro1.406s (-2.5%)2.010s (~)0.605s151.01x
🐘 PostgresExpress1.426s (-3.8%)2.010s (~)0.584s151.02x
🐘 PostgresNext.js (Turbopack)1.448s2.011s0.563s151.04x
💻 LocalNitro1.503s (+0.8%)2.005s (~)0.502s151.08x
💻 LocalNext.js (Turbopack)1.539s2.005s0.466s151.10x
💻 LocalExpress1.564s (+5.7% 🔺)2.006s (~)0.442s151.12x
🌐 MongoDBNext.js (Turbopack)2.159s3.008s0.850s101.55x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.150s (-6.1% 🟢)3.703s (-5.5% 🟢)1.553s91.00x
▲ VercelNext.js (Turbopack)2.251s (-10.5% 🟢)4.018s (-1.9%)1.768s81.05x
▲ VercelNitro2.305s (-14.9% 🟢)3.938s (-10.2% 🟢)1.633s81.07x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.566s (-1.4%)3.013s (~)0.447s101.00x
🌐 RedisNext.js (Turbopack)2.582s3.009s0.427s101.01x
🐘 PostgresNitro2.595s (~)3.012s (~)0.417s101.01x
💻 LocalNitro2.637s (-7.7% 🟢)3.007s (-10.0% 🟢)0.370s101.03x
💻 LocalNext.js (Turbopack)2.751s3.107s0.356s101.07x
🐘 PostgresNext.js (Turbopack)2.759s3.213s0.454s101.08x
💻 LocalExpress2.978s (+0.7%)3.564s (+7.7% 🔺)0.586s91.16x
🌐 MongoDBNext.js (Turbopack)4.670s5.177s0.507s61.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.567s (-4.4%)4.252s (+2.1%)1.685s81.00x
▲ VercelExpress2.843s (+12.8% 🔺)3.944s (-10.1% 🟢)1.100s81.11x
▲ VercelNext.js (Turbopack)2.890s (+8.4% 🔺)4.524s (-2.4%)1.635s71.13x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.916s (-1.8%)4.444s (-6.1% 🟢)0.528s71.00x
🐘 PostgresExpress4.020s (+0.7%)4.446s (~)0.426s71.03x
🌐 RedisNext.js (Turbopack)4.133s5.013s0.880s61.06x
🐘 PostgresNext.js (Turbopack)4.540s5.017s0.477s61.16x
💻 LocalNitro7.038s (-13.8% 🟢)7.416s (-17.8% 🟢)0.378s51.80x
💻 LocalNext.js (Turbopack)7.244s7.516s0.273s41.85x
💻 LocalExpress8.511s (+4.4%)9.022s (+2.9%)0.510s42.17x
🌐 MongoDBNext.js (Turbopack)9.758s10.348s0.590s32.49x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.898s (-15.7% 🟢)4.312s (-16.1% 🟢)1.413s71.00x
▲ VercelNitro3.676s (+20.1% 🔺)5.290s (+15.7% 🔺)1.614s61.27x
▲ VercelNext.js (Turbopack)3.739s (-1.7%)5.321s (-3.6%)1.583s61.29x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.330s2.007s0.676s151.00x
🐘 PostgresNitro1.407s (-1.0%)2.010s (~)0.603s151.06x
🐘 PostgresNext.js (Turbopack)1.437s2.011s0.574s151.08x
💻 LocalNitro1.477s (-3.6%)2.005s (~)0.528s151.11x
🐘 PostgresExpress1.496s (+8.1% 🔺)2.077s (+3.3%)0.581s151.12x
💻 LocalNext.js (Turbopack)1.531s2.005s0.475s151.15x
💻 LocalExpress1.539s (+0.5%)2.005s (~)0.466s151.16x
🌐 MongoDBNext.js (Turbopack)2.196s3.009s0.813s101.65x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.185s (-16.2% 🟢)3.438s (-22.8% 🟢)1.253s91.00x
▲ VercelNext.js (Turbopack)2.375s (+6.5% 🔺)3.752s (~)1.376s81.09x
▲ VercelNitro2.386s (+1.1%)4.575s (+0.6%)2.189s71.09x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.484s (-6.7% 🟢)3.010s (-3.3%)0.526s101.00x
🌐 RedisNext.js (Turbopack)2.560s3.008s0.448s101.03x
🐘 PostgresNext.js (Turbopack)2.564s3.012s0.448s101.03x
🐘 PostgresExpress2.609s (+3.7%)3.012s (~)0.403s101.05x
💻 LocalNitro2.707s (-11.3% 🟢)3.009s (-22.6% 🟢)0.302s101.09x
💻 LocalExpress3.041s (+1.7%)3.886s (+9.0% 🔺)0.845s81.22x
💻 LocalNext.js (Turbopack)3.070s3.759s0.689s81.24x
🌐 MongoDBNext.js (Turbopack)4.662s5.177s0.516s61.88x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.259s (-18.2% 🟢)3.694s (-9.9% 🟢)1.435s91.00x
▲ VercelNitro2.624s (+9.4% 🔺)4.394s (+8.4% 🔺)1.770s71.16x
▲ VercelNext.js (Turbopack)2.669s (+6.8% 🔺)4.250s (+6.8% 🔺)1.582s81.18x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.911s (-1.1%)4.590s (~)0.679s71.00x
🐘 PostgresNitro3.950s (-3.3%)4.588s (+3.2%)0.638s71.01x
🌐 RedisNext.js (Turbopack)4.255s5.011s0.756s61.09x
🐘 PostgresNext.js (Turbopack)4.556s5.021s0.466s61.16x
💻 LocalNitro7.397s (-20.4% 🟢)8.019s (-20.0% 🟢)0.622s41.89x
💻 LocalNext.js (Turbopack)8.347s8.767s0.420s42.13x
💻 LocalExpress8.882s (+1.7%)9.270s (+2.8%)0.388s42.27x
🌐 MongoDBNext.js (Turbopack)9.824s10.347s0.523s32.51x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.719s (-1.6%)4.485s (+10.9% 🔺)1.767s71.00x
▲ VercelNitro3.158s (+18.9% 🔺)4.745s (+21.7% 🔺)1.587s71.16x
▲ VercelNext.js (Turbopack)3.199s (-10.0% 🟢)5.271s (-3.5%)2.073s61.18x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.138s (-30.2% 🟢)1.003s (~)0.009s (-18.8% 🟢)1.016s (~)0.877s101.00x
🌐 RedisNext.js (Turbopack)0.175s1.000s0.001s1.008s0.833s101.26x
💻 LocalNext.js (Turbopack)0.178s1.001s0.011s1.017s0.839s101.29x
🐘 PostgresNext.js (Turbopack)0.198s1.002s0.001s1.013s0.815s101.43x
💻 LocalExpress0.207s (+6.1% 🔺)1.003s (~)0.012s (+7.0% 🔺)1.019s (~)0.812s101.49x
🐘 PostgresNitro0.213s (-3.7%)0.997s (~)0.002s (+15.4% 🔺)1.012s (~)0.799s101.54x
🐘 PostgresExpress0.218s (-1.6%)0.993s (~)0.002s (+25.0% 🔺)1.012s (~)0.794s101.58x
🌐 MongoDBNext.js (Turbopack)0.524s0.929s0.001s1.009s0.485s103.78x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.689s (-1.6%)2.686s (-1.1%)0.005s (~)3.325s (-5.4% 🟢)1.636s101.00x
▲ VercelExpress1.716s (-9.3% 🟢)2.758s (+21.0% 🔺)0.010s (+60.9% 🔺)3.369s (+6.1% 🔺)1.653s101.02x
▲ VercelNitro1.774s (+11.2% 🔺)2.720s (+1.0%)0.005s (-96.4% 🟢)3.297s (-3.6%)1.523s101.05x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro12/12
🐘 PostgresNext.js (Turbopack)6/12
▲ VercelExpress6/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres5/12
Next.js (Turbopack)🌐 Redis7/12
Nitro💻 Local5/12
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)

📋 View full workflow run

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Comment threadpackages/ai/src/agent/do-stream-step.ts
- Use space separator in operation.name (not dot) to match AI SDK
- Add resource.name attribute from functionId
- Use recordException() + setStatus() for error spans (preserves stack traces)
- Add context.with() for proper parent-child span propagation
- Make recordSpan self-initializing (remove initTelemetry two-phase requirement)
- Add recordInputs/recordOutputs to TelemetrySettings for sensitive data gating
- Add gen_ai.* semantic convention attributes to doStream span
- Add ai.toolCall.args gated by recordOutputs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Convert contextStorage AsyncLocalStorage from module-scoped to a
globalThis singleton using Symbol.for(). This prevents esbuild's
module scope duplication from creating separate ALS instances, which
caused AsyncLocalStorage.getStore() to return undefined inside tool
execute() callbacks.
Cherry-picked from 8ea3f89 (peter/v2-flow), excluding unrelated
v2-flow runtime changes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread.changeset/durable-agent-improvements.md Outdated
VaguelySeriousand others added 5 commits March 16, 2026 15:52
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Next.js 16.2.0-canary.100+ has a regression where @workflow/ai step
files are missing from the step bundle, causing "doStreamStep not
found" errors that hang the agent tests until timeout.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
DEV_TEST_CONFIG was only set in the dev test job, so prod and postgres
canary jobs didn't skip agent tests. Add NEXT_CANARY env var to all
three local e2e test jobs (dev, prod, postgres) and use it directly.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@karthikscale3karthikscale3 left a comment

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.

Changes look good to me.

  • o11y reporting matches 1:1 to aisdk
  • prepareStep addition looks good

@pranaygppranaygp left a comment

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.

we should really update the e2e tests and the DurableAgent/ToolLoopAgent integration compat tests to prevent regressions here and to validate tat the features actually work

thank you so much!!

VaguelySeriousand others added 5 commits March 16, 2026 17:07
- agentConstructorPrepareStepE2e: verifies agent-level prepareStep is
called for each LLM step through the full workflow runtime
- agentStreamPrepareStepOverrideE2e: verifies stream-level prepareStep
overrides constructor-level
- agentMultimodalToolResultE2e: verifies tools returning
LanguageModelV3ToolResultOutput (type: 'content') pass through the
serialization/deserialization boundary correctly
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add three tests to the ToolLoopAgent compat suite verifying:
- Constructor-level prepareStep is called on each LLM step
- Stream-level prepareStep overrides constructor-level
- Constructor prepareStep fires for every step in multi-step tool loops
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
prepareStep: ({ stepNumber }) => {
stepNumbers.push(stepNumber);
return {};
},

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.

I'm curious if prepareStep is typically used as a step function, or used inline in the workflow context itself?

I did a quick scan on AI sdk docs and looks like your example is exactly what it's typically used for :)

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 action needed - just curious

{ type: 'text', text: 'Here is the image' },
{ type: 'file-data', data: 'iVBORw0KGgo=', mediaType: 'image/png' },
],
};

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.

https://ai-sdk.dev/docs/ai-sdk-core/tools-and-tool-calling#multi-modal-tool-results

nit: should we actually use toModelOutput? looks like that's the intended way to use it since tool authors typically wouldn't write a tool to return in the model message format, but would use the converter

just to make the e2e tests more real? claude, you might want to validate that ToolLoopAgent also propagates this toModelOutput since that example was taken from generateText

@pranaygppranaygp left a comment

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.

lgtm - thanks for adding the tests. left some comments :)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants

@VaguelySerious@pranaygp@karthikscale3
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
DurableAgent: various compatibility fixes by VaguelySerious · Pull Request #1385 · vercel/workflow · GitHub
Skip to content

DurableAgent: various compatibility fixes - #1385

Merged
VaguelySerious merged 18 commits into
mainfrom
peter/combined-durable-agent-fixes
Mar 17, 2026
Merged

DurableAgent: various compatibility fixes#1385
VaguelySerious merged 18 commits into
mainfrom
peter/combined-durable-agent-fixes

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 14, 2026

Copy link
Copy Markdown
Member

Closes#1303 : Support prepareStep on DurableAgent constructor with stream-level override
Closes#1302 : Add InferDurableAgentTools and InferDurableAgentUIMessage type helpers
Closes#1376 : Fix AI_DownloadError for image URLs by defaulting to no-op download
Closes#1296 : Add telemetry span support (ai.streamText.doStream, ai.toolCall) via optional @opentelemetry/api
Closes#848: Allow LanguageModelV3ToolResultOutput results to pass through without json parsin
Closes#975: Documents the necessity of sendStart: false when writing custom UIMessageChunks

Co-Authored-By: @nicoalbanese

… fix, telemetry spans
- Add InferDurableAgentTools and InferDurableAgentUIMessage type helpers (#1302)
- Support prepareStep on DurableAgent constructor with stream-level override (#1303)
- Fix AI_DownloadError for image URLs by defaulting to no-op download (#1376)
- Add telemetry span support (ai.streamText.doStream, ai.toolCall) via optional @opentelemetry/api (#1296)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@VaguelySerious
VaguelySerious requested a review from a team as a code ownerMarch 14, 2026 00:18
@changeset-bot

changeset-botBot commented Mar 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 094fe61

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

This PR includes changesets to release 1 package
NameType
@workflow/aiPatch

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

vercelBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production747067814
✅ 💻 Local Development7700118888
✅ 📦 Local Production7700118888
✅ 🐘 Local Postgres7700118888
✅ 🪟 Windows710374
❌ 🌍 Community Worlds1165515186
✅ 📋 Other195027222
Total3439554663960

❌ Failed Tests

🌍 Community Worlds (55 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

turso (50 failed):

  • addTenWorkflow
  • addTenWorkflow
  • wellKnownAgentWorkflow (.well-known/agent)
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • importedStepOnlyWorkflow
  • hookWorkflow
  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • 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()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • 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
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control)

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6707
✅ example6707
✅ express6707
✅ fastify6707
✅ hono6707
✅ nextjs-turbopack7202
✅ nextjs-webpack7202
✅ nitro6707
✅ nuxt6707
✅ sveltekit6707
✅ vite6707
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7103
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5133
✅ redis-dev302
❌ redis5223
✅ turso-dev302
❌ turso4503
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6509
✅ e2e-local-postgres-nest-stable6509
✅ e2e-local-prod-nest-stable6509

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.039s (-8.7% 🟢)1.006s (~)0.967s101.00x
💻 LocalExpress0.046s (+2.0%)1.005s (-2.0%)0.960s101.18x
💻 LocalNext.js (Turbopack)0.049s1.005s0.956s101.27x
🌐 RedisNext.js (Turbopack)0.054s1.005s0.952s101.39x
🐘 PostgresNext.js (Turbopack)0.061s1.011s0.950s101.57x
🐘 PostgresExpress0.063s (-1.1%)1.012s (~)0.949s101.62x
🐘 PostgresNitro0.067s (+7.7% 🔺)1.017s (+0.5%)0.950s101.74x
🌐 MongoDBNext.js (Turbopack)0.132s1.007s0.876s103.40x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.432s (-54.7% 🟢)2.416s (-18.6% 🟢)1.985s101.00x
▲ VercelExpress0.473s (+1.2%)2.454s (-10.0% 🟢)1.980s101.10x
▲ VercelNitro0.486s (-28.1% 🟢)2.572s (+3.6%)2.085s101.13x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.097s (-2.4%)2.006s (~)0.909s101.00x
💻 LocalNext.js (Turbopack)1.116s2.005s0.889s101.02x
🌐 RedisNext.js (Turbopack)1.132s2.007s0.875s101.03x
💻 LocalExpress1.135s (+1.0%)2.007s (~)0.871s101.04x
🐘 PostgresNext.js (Turbopack)1.146s2.012s0.866s101.05x
🐘 PostgresExpress1.146s (~)2.011s (~)0.865s101.05x
🐘 PostgresNitro1.147s (~)2.013s (~)0.865s101.05x
🌐 MongoDBNext.js (Turbopack)1.306s2.009s0.703s101.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.024s (-5.8% 🟢)3.561s (-6.7% 🟢)1.537s101.00x
▲ VercelExpress2.054s (-1.0%)3.521s (-3.3%)1.467s101.01x
▲ VercelNitro2.169s (-16.8% 🟢)3.862s (-17.8% 🟢)1.693s101.07x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.630s (-2.5%)11.024s (~)0.394s31.00x
💻 LocalNext.js (Turbopack)10.802s11.023s0.221s31.02x
🌐 RedisNext.js (Turbopack)10.812s11.023s0.211s31.02x
🐘 PostgresNext.js (Turbopack)10.836s11.037s0.202s31.02x
💻 LocalExpress10.902s (~)11.024s (~)0.122s31.03x
🐘 PostgresExpress10.932s (~)11.038s (~)0.106s31.03x
🐘 PostgresNitro10.939s (~)11.039s (~)0.100s31.03x
🌐 MongoDBNext.js (Turbopack)12.271s13.022s0.751s31.15x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express16.422s (-3.1%)17.403s (-4.7%)0.981s21.00x
▲ VercelNitro16.722s (-4.4%)18.741s (-7.7% 🟢)2.019s21.02x
▲ VercelNext.js (Turbopack)18.961s (+8.2% 🔺)20.762s (+8.0% 🔺)1.801s21.15x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro26.775s (-2.5%)27.053s (-3.6%)0.278s31.00x
🌐 RedisNext.js (Turbopack)26.787s27.052s0.265s31.00x
🐘 PostgresNext.js (Turbopack)27.016s27.395s0.379s31.01x
🐘 PostgresExpress27.132s (~)27.727s (-1.2%)0.595s31.01x
🐘 PostgresNitro27.235s (~)28.063s (~)0.828s31.02x
💻 LocalNext.js (Turbopack)27.255s28.054s0.799s31.02x
💻 LocalExpress27.513s (~)28.053s (~)0.540s31.03x
🌐 MongoDBNext.js (Turbopack)30.389s31.037s0.649s21.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)45.154s (+2.7%)47.613s (+2.5%)2.459s21.00x
▲ VercelExpress45.218s (+3.1%)46.945s (+2.1%)1.727s21.00x
▲ VercelNitro45.293s (+4.1%)46.791s (+2.7%)1.498s21.00x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)53.414s54.097s0.683s21.00x
🐘 PostgresNext.js (Turbopack)53.876s54.094s0.218s21.01x
🐘 PostgresNitro54.282s (~)55.097s (~)0.815s21.02x
🐘 PostgresExpress54.301s (~)55.100s (~)0.799s21.02x
💻 LocalNitro54.970s (-3.0%)55.107s (-3.5%)0.137s21.03x
💻 LocalNext.js (Turbopack)55.942s56.100s0.158s21.05x
💻 LocalExpress56.868s (~)57.102s (~)0.234s21.06x
🌐 MongoDBNext.js (Turbopack)60.595s61.067s0.472s21.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)93.323s (-3.2%)94.121s (-4.5%)0.798s11.00x
▲ VercelExpress94.753s (+2.1%)97.186s (+3.1%)2.433s11.02x
▲ VercelNitro97.185s (+1.5%)98.493s (+0.6%)1.308s11.04x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.395s2.006s0.612s151.00x
🐘 PostgresNitro1.406s (-2.5%)2.010s (~)0.605s151.01x
🐘 PostgresExpress1.426s (-3.8%)2.010s (~)0.584s151.02x
🐘 PostgresNext.js (Turbopack)1.448s2.011s0.563s151.04x
💻 LocalNitro1.503s (+0.8%)2.005s (~)0.502s151.08x
💻 LocalNext.js (Turbopack)1.539s2.005s0.466s151.10x
💻 LocalExpress1.564s (+5.7% 🔺)2.006s (~)0.442s151.12x
🌐 MongoDBNext.js (Turbopack)2.159s3.008s0.850s101.55x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.150s (-6.1% 🟢)3.703s (-5.5% 🟢)1.553s91.00x
▲ VercelNext.js (Turbopack)2.251s (-10.5% 🟢)4.018s (-1.9%)1.768s81.05x
▲ VercelNitro2.305s (-14.9% 🟢)3.938s (-10.2% 🟢)1.633s81.07x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.566s (-1.4%)3.013s (~)0.447s101.00x
🌐 RedisNext.js (Turbopack)2.582s3.009s0.427s101.01x
🐘 PostgresNitro2.595s (~)3.012s (~)0.417s101.01x
💻 LocalNitro2.637s (-7.7% 🟢)3.007s (-10.0% 🟢)0.370s101.03x
💻 LocalNext.js (Turbopack)2.751s3.107s0.356s101.07x
🐘 PostgresNext.js (Turbopack)2.759s3.213s0.454s101.08x
💻 LocalExpress2.978s (+0.7%)3.564s (+7.7% 🔺)0.586s91.16x
🌐 MongoDBNext.js (Turbopack)4.670s5.177s0.507s61.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.567s (-4.4%)4.252s (+2.1%)1.685s81.00x
▲ VercelExpress2.843s (+12.8% 🔺)3.944s (-10.1% 🟢)1.100s81.11x
▲ VercelNext.js (Turbopack)2.890s (+8.4% 🔺)4.524s (-2.4%)1.635s71.13x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.916s (-1.8%)4.444s (-6.1% 🟢)0.528s71.00x
🐘 PostgresExpress4.020s (+0.7%)4.446s (~)0.426s71.03x
🌐 RedisNext.js (Turbopack)4.133s5.013s0.880s61.06x
🐘 PostgresNext.js (Turbopack)4.540s5.017s0.477s61.16x
💻 LocalNitro7.038s (-13.8% 🟢)7.416s (-17.8% 🟢)0.378s51.80x
💻 LocalNext.js (Turbopack)7.244s7.516s0.273s41.85x
💻 LocalExpress8.511s (+4.4%)9.022s (+2.9%)0.510s42.17x
🌐 MongoDBNext.js (Turbopack)9.758s10.348s0.590s32.49x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.898s (-15.7% 🟢)4.312s (-16.1% 🟢)1.413s71.00x
▲ VercelNitro3.676s (+20.1% 🔺)5.290s (+15.7% 🔺)1.614s61.27x
▲ VercelNext.js (Turbopack)3.739s (-1.7%)5.321s (-3.6%)1.583s61.29x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.330s2.007s0.676s151.00x
🐘 PostgresNitro1.407s (-1.0%)2.010s (~)0.603s151.06x
🐘 PostgresNext.js (Turbopack)1.437s2.011s0.574s151.08x
💻 LocalNitro1.477s (-3.6%)2.005s (~)0.528s151.11x
🐘 PostgresExpress1.496s (+8.1% 🔺)2.077s (+3.3%)0.581s151.12x
💻 LocalNext.js (Turbopack)1.531s2.005s0.475s151.15x
💻 LocalExpress1.539s (+0.5%)2.005s (~)0.466s151.16x
🌐 MongoDBNext.js (Turbopack)2.196s3.009s0.813s101.65x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.185s (-16.2% 🟢)3.438s (-22.8% 🟢)1.253s91.00x
▲ VercelNext.js (Turbopack)2.375s (+6.5% 🔺)3.752s (~)1.376s81.09x
▲ VercelNitro2.386s (+1.1%)4.575s (+0.6%)2.189s71.09x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.484s (-6.7% 🟢)3.010s (-3.3%)0.526s101.00x
🌐 RedisNext.js (Turbopack)2.560s3.008s0.448s101.03x
🐘 PostgresNext.js (Turbopack)2.564s3.012s0.448s101.03x
🐘 PostgresExpress2.609s (+3.7%)3.012s (~)0.403s101.05x
💻 LocalNitro2.707s (-11.3% 🟢)3.009s (-22.6% 🟢)0.302s101.09x
💻 LocalExpress3.041s (+1.7%)3.886s (+9.0% 🔺)0.845s81.22x
💻 LocalNext.js (Turbopack)3.070s3.759s0.689s81.24x
🌐 MongoDBNext.js (Turbopack)4.662s5.177s0.516s61.88x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.259s (-18.2% 🟢)3.694s (-9.9% 🟢)1.435s91.00x
▲ VercelNitro2.624s (+9.4% 🔺)4.394s (+8.4% 🔺)1.770s71.16x
▲ VercelNext.js (Turbopack)2.669s (+6.8% 🔺)4.250s (+6.8% 🔺)1.582s81.18x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.911s (-1.1%)4.590s (~)0.679s71.00x
🐘 PostgresNitro3.950s (-3.3%)4.588s (+3.2%)0.638s71.01x
🌐 RedisNext.js (Turbopack)4.255s5.011s0.756s61.09x
🐘 PostgresNext.js (Turbopack)4.556s5.021s0.466s61.16x
💻 LocalNitro7.397s (-20.4% 🟢)8.019s (-20.0% 🟢)0.622s41.89x
💻 LocalNext.js (Turbopack)8.347s8.767s0.420s42.13x
💻 LocalExpress8.882s (+1.7%)9.270s (+2.8%)0.388s42.27x
🌐 MongoDBNext.js (Turbopack)9.824s10.347s0.523s32.51x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.719s (-1.6%)4.485s (+10.9% 🔺)1.767s71.00x
▲ VercelNitro3.158s (+18.9% 🔺)4.745s (+21.7% 🔺)1.587s71.16x
▲ VercelNext.js (Turbopack)3.199s (-10.0% 🟢)5.271s (-3.5%)2.073s61.18x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.138s (-30.2% 🟢)1.003s (~)0.009s (-18.8% 🟢)1.016s (~)0.877s101.00x
🌐 RedisNext.js (Turbopack)0.175s1.000s0.001s1.008s0.833s101.26x
💻 LocalNext.js (Turbopack)0.178s1.001s0.011s1.017s0.839s101.29x
🐘 PostgresNext.js (Turbopack)0.198s1.002s0.001s1.013s0.815s101.43x
💻 LocalExpress0.207s (+6.1% 🔺)1.003s (~)0.012s (+7.0% 🔺)1.019s (~)0.812s101.49x
🐘 PostgresNitro0.213s (-3.7%)0.997s (~)0.002s (+15.4% 🔺)1.012s (~)0.799s101.54x
🐘 PostgresExpress0.218s (-1.6%)0.993s (~)0.002s (+25.0% 🔺)1.012s (~)0.794s101.58x
🌐 MongoDBNext.js (Turbopack)0.524s0.929s0.001s1.009s0.485s103.78x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.689s (-1.6%)2.686s (-1.1%)0.005s (~)3.325s (-5.4% 🟢)1.636s101.00x
▲ VercelExpress1.716s (-9.3% 🟢)2.758s (+21.0% 🔺)0.010s (+60.9% 🔺)3.369s (+6.1% 🔺)1.653s101.02x
▲ VercelNitro1.774s (+11.2% 🔺)2.720s (+1.0%)0.005s (-96.4% 🟢)3.297s (-3.6%)1.523s101.05x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro12/12
🐘 PostgresNext.js (Turbopack)6/12
▲ VercelExpress6/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres5/12
Next.js (Turbopack)🌐 Redis7/12
Nitro💻 Local5/12
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)

📋 View full workflow run

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Comment threadpackages/ai/src/agent/do-stream-step.ts
- Use space separator in operation.name (not dot) to match AI SDK
- Add resource.name attribute from functionId
- Use recordException() + setStatus() for error spans (preserves stack traces)
- Add context.with() for proper parent-child span propagation
- Make recordSpan self-initializing (remove initTelemetry two-phase requirement)
- Add recordInputs/recordOutputs to TelemetrySettings for sensitive data gating
- Add gen_ai.* semantic convention attributes to doStream span
- Add ai.toolCall.args gated by recordOutputs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Convert contextStorage AsyncLocalStorage from module-scoped to a
globalThis singleton using Symbol.for(). This prevents esbuild's
module scope duplication from creating separate ALS instances, which
caused AsyncLocalStorage.getStore() to return undefined inside tool
execute() callbacks.
Cherry-picked from 8ea3f89 (peter/v2-flow), excluding unrelated
v2-flow runtime changes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread.changeset/durable-agent-improvements.md Outdated
VaguelySeriousand others added 5 commits March 16, 2026 15:52
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Next.js 16.2.0-canary.100+ has a regression where @workflow/ai step
files are missing from the step bundle, causing "doStreamStep not
found" errors that hang the agent tests until timeout.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
DEV_TEST_CONFIG was only set in the dev test job, so prod and postgres
canary jobs didn't skip agent tests. Add NEXT_CANARY env var to all
three local e2e test jobs (dev, prod, postgres) and use it directly.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@karthikscale3karthikscale3 left a comment

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.

Changes look good to me.

  • o11y reporting matches 1:1 to aisdk
  • prepareStep addition looks good

@pranaygppranaygp left a comment

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.

we should really update the e2e tests and the DurableAgent/ToolLoopAgent integration compat tests to prevent regressions here and to validate tat the features actually work

thank you so much!!

VaguelySeriousand others added 5 commits March 16, 2026 17:07
- agentConstructorPrepareStepE2e: verifies agent-level prepareStep is
called for each LLM step through the full workflow runtime
- agentStreamPrepareStepOverrideE2e: verifies stream-level prepareStep
overrides constructor-level
- agentMultimodalToolResultE2e: verifies tools returning
LanguageModelV3ToolResultOutput (type: 'content') pass through the
serialization/deserialization boundary correctly
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add three tests to the ToolLoopAgent compat suite verifying:
- Constructor-level prepareStep is called on each LLM step
- Stream-level prepareStep overrides constructor-level
- Constructor prepareStep fires for every step in multi-step tool loops
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
prepareStep: ({ stepNumber }) => {
stepNumbers.push(stepNumber);
return {};
},

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.

I'm curious if prepareStep is typically used as a step function, or used inline in the workflow context itself?

I did a quick scan on AI sdk docs and looks like your example is exactly what it's typically used for :)

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 action needed - just curious

{ type: 'text', text: 'Here is the image' },
{ type: 'file-data', data: 'iVBORw0KGgo=', mediaType: 'image/png' },
],
};

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.

https://ai-sdk.dev/docs/ai-sdk-core/tools-and-tool-calling#multi-modal-tool-results

nit: should we actually use toModelOutput? looks like that's the intended way to use it since tool authors typically wouldn't write a tool to return in the model message format, but would use the converter

just to make the e2e tests more real? claude, you might want to validate that ToolLoopAgent also propagates this toModelOutput since that example was taken from generateText

@pranaygppranaygp left a comment

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.

lgtm - thanks for adding the tests. left some comments :)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants

@VaguelySerious@pranaygp@karthikscale3
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' DurableAgent: various compatibility fixes by VaguelySerious · Pull Request #1385 · vercel/workflow · GitHub
Skip to content

DurableAgent: various compatibility fixes - #1385

Merged
VaguelySerious merged 18 commits into
mainfrom
peter/combined-durable-agent-fixes
Mar 17, 2026
Merged

DurableAgent: various compatibility fixes#1385
VaguelySerious merged 18 commits into
mainfrom
peter/combined-durable-agent-fixes

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 14, 2026

Copy link
Copy Markdown
Member

Closes#1303 : Support prepareStep on DurableAgent constructor with stream-level override
Closes#1302 : Add InferDurableAgentTools and InferDurableAgentUIMessage type helpers
Closes#1376 : Fix AI_DownloadError for image URLs by defaulting to no-op download
Closes#1296 : Add telemetry span support (ai.streamText.doStream, ai.toolCall) via optional @opentelemetry/api
Closes#848: Allow LanguageModelV3ToolResultOutput results to pass through without json parsin
Closes#975: Documents the necessity of sendStart: false when writing custom UIMessageChunks

Co-Authored-By: @nicoalbanese

… fix, telemetry spans
- Add InferDurableAgentTools and InferDurableAgentUIMessage type helpers (#1302)
- Support prepareStep on DurableAgent constructor with stream-level override (#1303)
- Fix AI_DownloadError for image URLs by defaulting to no-op download (#1376)
- Add telemetry span support (ai.streamText.doStream, ai.toolCall) via optional @opentelemetry/api (#1296)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@VaguelySerious
VaguelySerious requested a review from a team as a code ownerMarch 14, 2026 00:18
@changeset-bot

changeset-botBot commented Mar 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 094fe61

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

This PR includes changesets to release 1 package
NameType
@workflow/aiPatch

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

vercelBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production747067814
✅ 💻 Local Development7700118888
✅ 📦 Local Production7700118888
✅ 🐘 Local Postgres7700118888
✅ 🪟 Windows710374
❌ 🌍 Community Worlds1165515186
✅ 📋 Other195027222
Total3439554663960

❌ Failed Tests

🌍 Community Worlds (55 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

turso (50 failed):

  • addTenWorkflow
  • addTenWorkflow
  • wellKnownAgentWorkflow (.well-known/agent)
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • importedStepOnlyWorkflow
  • hookWorkflow
  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • 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()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • 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
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control)

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6707
✅ example6707
✅ express6707
✅ fastify6707
✅ hono6707
✅ nextjs-turbopack7202
✅ nextjs-webpack7202
✅ nitro6707
✅ nuxt6707
✅ sveltekit6707
✅ vite6707
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7103
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5133
✅ redis-dev302
❌ redis5223
✅ turso-dev302
❌ turso4503
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6509
✅ e2e-local-postgres-nest-stable6509
✅ e2e-local-prod-nest-stable6509

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.039s (-8.7% 🟢)1.006s (~)0.967s101.00x
💻 LocalExpress0.046s (+2.0%)1.005s (-2.0%)0.960s101.18x
💻 LocalNext.js (Turbopack)0.049s1.005s0.956s101.27x
🌐 RedisNext.js (Turbopack)0.054s1.005s0.952s101.39x
🐘 PostgresNext.js (Turbopack)0.061s1.011s0.950s101.57x
🐘 PostgresExpress0.063s (-1.1%)1.012s (~)0.949s101.62x
🐘 PostgresNitro0.067s (+7.7% 🔺)1.017s (+0.5%)0.950s101.74x
🌐 MongoDBNext.js (Turbopack)0.132s1.007s0.876s103.40x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.432s (-54.7% 🟢)2.416s (-18.6% 🟢)1.985s101.00x
▲ VercelExpress0.473s (+1.2%)2.454s (-10.0% 🟢)1.980s101.10x
▲ VercelNitro0.486s (-28.1% 🟢)2.572s (+3.6%)2.085s101.13x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.097s (-2.4%)2.006s (~)0.909s101.00x
💻 LocalNext.js (Turbopack)1.116s2.005s0.889s101.02x
🌐 RedisNext.js (Turbopack)1.132s2.007s0.875s101.03x
💻 LocalExpress1.135s (+1.0%)2.007s (~)0.871s101.04x
🐘 PostgresNext.js (Turbopack)1.146s2.012s0.866s101.05x
🐘 PostgresExpress1.146s (~)2.011s (~)0.865s101.05x
🐘 PostgresNitro1.147s (~)2.013s (~)0.865s101.05x
🌐 MongoDBNext.js (Turbopack)1.306s2.009s0.703s101.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.024s (-5.8% 🟢)3.561s (-6.7% 🟢)1.537s101.00x
▲ VercelExpress2.054s (-1.0%)3.521s (-3.3%)1.467s101.01x
▲ VercelNitro2.169s (-16.8% 🟢)3.862s (-17.8% 🟢)1.693s101.07x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.630s (-2.5%)11.024s (~)0.394s31.00x
💻 LocalNext.js (Turbopack)10.802s11.023s0.221s31.02x
🌐 RedisNext.js (Turbopack)10.812s11.023s0.211s31.02x
🐘 PostgresNext.js (Turbopack)10.836s11.037s0.202s31.02x
💻 LocalExpress10.902s (~)11.024s (~)0.122s31.03x
🐘 PostgresExpress10.932s (~)11.038s (~)0.106s31.03x
🐘 PostgresNitro10.939s (~)11.039s (~)0.100s31.03x
🌐 MongoDBNext.js (Turbopack)12.271s13.022s0.751s31.15x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express16.422s (-3.1%)17.403s (-4.7%)0.981s21.00x
▲ VercelNitro16.722s (-4.4%)18.741s (-7.7% 🟢)2.019s21.02x
▲ VercelNext.js (Turbopack)18.961s (+8.2% 🔺)20.762s (+8.0% 🔺)1.801s21.15x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro26.775s (-2.5%)27.053s (-3.6%)0.278s31.00x
🌐 RedisNext.js (Turbopack)26.787s27.052s0.265s31.00x
🐘 PostgresNext.js (Turbopack)27.016s27.395s0.379s31.01x
🐘 PostgresExpress27.132s (~)27.727s (-1.2%)0.595s31.01x
🐘 PostgresNitro27.235s (~)28.063s (~)0.828s31.02x
💻 LocalNext.js (Turbopack)27.255s28.054s0.799s31.02x
💻 LocalExpress27.513s (~)28.053s (~)0.540s31.03x
🌐 MongoDBNext.js (Turbopack)30.389s31.037s0.649s21.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)45.154s (+2.7%)47.613s (+2.5%)2.459s21.00x
▲ VercelExpress45.218s (+3.1%)46.945s (+2.1%)1.727s21.00x
▲ VercelNitro45.293s (+4.1%)46.791s (+2.7%)1.498s21.00x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)53.414s54.097s0.683s21.00x
🐘 PostgresNext.js (Turbopack)53.876s54.094s0.218s21.01x
🐘 PostgresNitro54.282s (~)55.097s (~)0.815s21.02x
🐘 PostgresExpress54.301s (~)55.100s (~)0.799s21.02x
💻 LocalNitro54.970s (-3.0%)55.107s (-3.5%)0.137s21.03x
💻 LocalNext.js (Turbopack)55.942s56.100s0.158s21.05x
💻 LocalExpress56.868s (~)57.102s (~)0.234s21.06x
🌐 MongoDBNext.js (Turbopack)60.595s61.067s0.472s21.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)93.323s (-3.2%)94.121s (-4.5%)0.798s11.00x
▲ VercelExpress94.753s (+2.1%)97.186s (+3.1%)2.433s11.02x
▲ VercelNitro97.185s (+1.5%)98.493s (+0.6%)1.308s11.04x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.395s2.006s0.612s151.00x
🐘 PostgresNitro1.406s (-2.5%)2.010s (~)0.605s151.01x
🐘 PostgresExpress1.426s (-3.8%)2.010s (~)0.584s151.02x
🐘 PostgresNext.js (Turbopack)1.448s2.011s0.563s151.04x
💻 LocalNitro1.503s (+0.8%)2.005s (~)0.502s151.08x
💻 LocalNext.js (Turbopack)1.539s2.005s0.466s151.10x
💻 LocalExpress1.564s (+5.7% 🔺)2.006s (~)0.442s151.12x
🌐 MongoDBNext.js (Turbopack)2.159s3.008s0.850s101.55x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.150s (-6.1% 🟢)3.703s (-5.5% 🟢)1.553s91.00x
▲ VercelNext.js (Turbopack)2.251s (-10.5% 🟢)4.018s (-1.9%)1.768s81.05x
▲ VercelNitro2.305s (-14.9% 🟢)3.938s (-10.2% 🟢)1.633s81.07x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.566s (-1.4%)3.013s (~)0.447s101.00x
🌐 RedisNext.js (Turbopack)2.582s3.009s0.427s101.01x
🐘 PostgresNitro2.595s (~)3.012s (~)0.417s101.01x
💻 LocalNitro2.637s (-7.7% 🟢)3.007s (-10.0% 🟢)0.370s101.03x
💻 LocalNext.js (Turbopack)2.751s3.107s0.356s101.07x
🐘 PostgresNext.js (Turbopack)2.759s3.213s0.454s101.08x
💻 LocalExpress2.978s (+0.7%)3.564s (+7.7% 🔺)0.586s91.16x
🌐 MongoDBNext.js (Turbopack)4.670s5.177s0.507s61.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.567s (-4.4%)4.252s (+2.1%)1.685s81.00x
▲ VercelExpress2.843s (+12.8% 🔺)3.944s (-10.1% 🟢)1.100s81.11x
▲ VercelNext.js (Turbopack)2.890s (+8.4% 🔺)4.524s (-2.4%)1.635s71.13x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.916s (-1.8%)4.444s (-6.1% 🟢)0.528s71.00x
🐘 PostgresExpress4.020s (+0.7%)4.446s (~)0.426s71.03x
🌐 RedisNext.js (Turbopack)4.133s5.013s0.880s61.06x
🐘 PostgresNext.js (Turbopack)4.540s5.017s0.477s61.16x
💻 LocalNitro7.038s (-13.8% 🟢)7.416s (-17.8% 🟢)0.378s51.80x
💻 LocalNext.js (Turbopack)7.244s7.516s0.273s41.85x
💻 LocalExpress8.511s (+4.4%)9.022s (+2.9%)0.510s42.17x
🌐 MongoDBNext.js (Turbopack)9.758s10.348s0.590s32.49x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.898s (-15.7% 🟢)4.312s (-16.1% 🟢)1.413s71.00x
▲ VercelNitro3.676s (+20.1% 🔺)5.290s (+15.7% 🔺)1.614s61.27x
▲ VercelNext.js (Turbopack)3.739s (-1.7%)5.321s (-3.6%)1.583s61.29x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.330s2.007s0.676s151.00x
🐘 PostgresNitro1.407s (-1.0%)2.010s (~)0.603s151.06x
🐘 PostgresNext.js (Turbopack)1.437s2.011s0.574s151.08x
💻 LocalNitro1.477s (-3.6%)2.005s (~)0.528s151.11x
🐘 PostgresExpress1.496s (+8.1% 🔺)2.077s (+3.3%)0.581s151.12x
💻 LocalNext.js (Turbopack)1.531s2.005s0.475s151.15x
💻 LocalExpress1.539s (+0.5%)2.005s (~)0.466s151.16x
🌐 MongoDBNext.js (Turbopack)2.196s3.009s0.813s101.65x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.185s (-16.2% 🟢)3.438s (-22.8% 🟢)1.253s91.00x
▲ VercelNext.js (Turbopack)2.375s (+6.5% 🔺)3.752s (~)1.376s81.09x
▲ VercelNitro2.386s (+1.1%)4.575s (+0.6%)2.189s71.09x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.484s (-6.7% 🟢)3.010s (-3.3%)0.526s101.00x
🌐 RedisNext.js (Turbopack)2.560s3.008s0.448s101.03x
🐘 PostgresNext.js (Turbopack)2.564s3.012s0.448s101.03x
🐘 PostgresExpress2.609s (+3.7%)3.012s (~)0.403s101.05x
💻 LocalNitro2.707s (-11.3% 🟢)3.009s (-22.6% 🟢)0.302s101.09x
💻 LocalExpress3.041s (+1.7%)3.886s (+9.0% 🔺)0.845s81.22x
💻 LocalNext.js (Turbopack)3.070s3.759s0.689s81.24x
🌐 MongoDBNext.js (Turbopack)4.662s5.177s0.516s61.88x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.259s (-18.2% 🟢)3.694s (-9.9% 🟢)1.435s91.00x
▲ VercelNitro2.624s (+9.4% 🔺)4.394s (+8.4% 🔺)1.770s71.16x
▲ VercelNext.js (Turbopack)2.669s (+6.8% 🔺)4.250s (+6.8% 🔺)1.582s81.18x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.911s (-1.1%)4.590s (~)0.679s71.00x
🐘 PostgresNitro3.950s (-3.3%)4.588s (+3.2%)0.638s71.01x
🌐 RedisNext.js (Turbopack)4.255s5.011s0.756s61.09x
🐘 PostgresNext.js (Turbopack)4.556s5.021s0.466s61.16x
💻 LocalNitro7.397s (-20.4% 🟢)8.019s (-20.0% 🟢)0.622s41.89x
💻 LocalNext.js (Turbopack)8.347s8.767s0.420s42.13x
💻 LocalExpress8.882s (+1.7%)9.270s (+2.8%)0.388s42.27x
🌐 MongoDBNext.js (Turbopack)9.824s10.347s0.523s32.51x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.719s (-1.6%)4.485s (+10.9% 🔺)1.767s71.00x
▲ VercelNitro3.158s (+18.9% 🔺)4.745s (+21.7% 🔺)1.587s71.16x
▲ VercelNext.js (Turbopack)3.199s (-10.0% 🟢)5.271s (-3.5%)2.073s61.18x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.138s (-30.2% 🟢)1.003s (~)0.009s (-18.8% 🟢)1.016s (~)0.877s101.00x
🌐 RedisNext.js (Turbopack)0.175s1.000s0.001s1.008s0.833s101.26x
💻 LocalNext.js (Turbopack)0.178s1.001s0.011s1.017s0.839s101.29x
🐘 PostgresNext.js (Turbopack)0.198s1.002s0.001s1.013s0.815s101.43x
💻 LocalExpress0.207s (+6.1% 🔺)1.003s (~)0.012s (+7.0% 🔺)1.019s (~)0.812s101.49x
🐘 PostgresNitro0.213s (-3.7%)0.997s (~)0.002s (+15.4% 🔺)1.012s (~)0.799s101.54x
🐘 PostgresExpress0.218s (-1.6%)0.993s (~)0.002s (+25.0% 🔺)1.012s (~)0.794s101.58x
🌐 MongoDBNext.js (Turbopack)0.524s0.929s0.001s1.009s0.485s103.78x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.689s (-1.6%)2.686s (-1.1%)0.005s (~)3.325s (-5.4% 🟢)1.636s101.00x
▲ VercelExpress1.716s (-9.3% 🟢)2.758s (+21.0% 🔺)0.010s (+60.9% 🔺)3.369s (+6.1% 🔺)1.653s101.02x
▲ VercelNitro1.774s (+11.2% 🔺)2.720s (+1.0%)0.005s (-96.4% 🟢)3.297s (-3.6%)1.523s101.05x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro12/12
🐘 PostgresNext.js (Turbopack)6/12
▲ VercelExpress6/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres5/12
Next.js (Turbopack)🌐 Redis7/12
Nitro💻 Local5/12
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)

📋 View full workflow run

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Comment threadpackages/ai/src/agent/do-stream-step.ts
- Use space separator in operation.name (not dot) to match AI SDK
- Add resource.name attribute from functionId
- Use recordException() + setStatus() for error spans (preserves stack traces)
- Add context.with() for proper parent-child span propagation
- Make recordSpan self-initializing (remove initTelemetry two-phase requirement)
- Add recordInputs/recordOutputs to TelemetrySettings for sensitive data gating
- Add gen_ai.* semantic convention attributes to doStream span
- Add ai.toolCall.args gated by recordOutputs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Convert contextStorage AsyncLocalStorage from module-scoped to a
globalThis singleton using Symbol.for(). This prevents esbuild's
module scope duplication from creating separate ALS instances, which
caused AsyncLocalStorage.getStore() to return undefined inside tool
execute() callbacks.
Cherry-picked from 8ea3f89 (peter/v2-flow), excluding unrelated
v2-flow runtime changes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread.changeset/durable-agent-improvements.md Outdated
VaguelySeriousand others added 5 commits March 16, 2026 15:52
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Next.js 16.2.0-canary.100+ has a regression where @workflow/ai step
files are missing from the step bundle, causing "doStreamStep not
found" errors that hang the agent tests until timeout.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
DEV_TEST_CONFIG was only set in the dev test job, so prod and postgres
canary jobs didn't skip agent tests. Add NEXT_CANARY env var to all
three local e2e test jobs (dev, prod, postgres) and use it directly.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@karthikscale3karthikscale3 left a comment

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.

Changes look good to me.

  • o11y reporting matches 1:1 to aisdk
  • prepareStep addition looks good

@pranaygppranaygp left a comment

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.

we should really update the e2e tests and the DurableAgent/ToolLoopAgent integration compat tests to prevent regressions here and to validate tat the features actually work

thank you so much!!

VaguelySeriousand others added 5 commits March 16, 2026 17:07
- agentConstructorPrepareStepE2e: verifies agent-level prepareStep is
called for each LLM step through the full workflow runtime
- agentStreamPrepareStepOverrideE2e: verifies stream-level prepareStep
overrides constructor-level
- agentMultimodalToolResultE2e: verifies tools returning
LanguageModelV3ToolResultOutput (type: 'content') pass through the
serialization/deserialization boundary correctly
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add three tests to the ToolLoopAgent compat suite verifying:
- Constructor-level prepareStep is called on each LLM step
- Stream-level prepareStep overrides constructor-level
- Constructor prepareStep fires for every step in multi-step tool loops
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
prepareStep: ({ stepNumber }) => {
stepNumbers.push(stepNumber);
return {};
},

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.

I'm curious if prepareStep is typically used as a step function, or used inline in the workflow context itself?

I did a quick scan on AI sdk docs and looks like your example is exactly what it's typically used for :)

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 action needed - just curious

{ type: 'text', text: 'Here is the image' },
{ type: 'file-data', data: 'iVBORw0KGgo=', mediaType: 'image/png' },
],
};

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.

https://ai-sdk.dev/docs/ai-sdk-core/tools-and-tool-calling#multi-modal-tool-results

nit: should we actually use toModelOutput? looks like that's the intended way to use it since tool authors typically wouldn't write a tool to return in the model message format, but would use the converter

just to make the e2e tests more real? claude, you might want to validate that ToolLoopAgent also propagates this toModelOutput since that example was taken from generateText

@pranaygppranaygp left a comment

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.

lgtm - thanks for adding the tests. left some comments :)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants

@VaguelySerious@pranaygp@karthikscale3
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' DurableAgent: various compatibility fixes by VaguelySerious · Pull Request #1385 · vercel/workflow · GitHub
Skip to content

DurableAgent: various compatibility fixes - #1385

Merged
VaguelySerious merged 18 commits into
mainfrom
peter/combined-durable-agent-fixes
Mar 17, 2026
Merged

DurableAgent: various compatibility fixes#1385
VaguelySerious merged 18 commits into
mainfrom
peter/combined-durable-agent-fixes

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 14, 2026

Copy link
Copy Markdown
Member

Closes#1303 : Support prepareStep on DurableAgent constructor with stream-level override
Closes#1302 : Add InferDurableAgentTools and InferDurableAgentUIMessage type helpers
Closes#1376 : Fix AI_DownloadError for image URLs by defaulting to no-op download
Closes#1296 : Add telemetry span support (ai.streamText.doStream, ai.toolCall) via optional @opentelemetry/api
Closes#848: Allow LanguageModelV3ToolResultOutput results to pass through without json parsin
Closes#975: Documents the necessity of sendStart: false when writing custom UIMessageChunks

Co-Authored-By: @nicoalbanese

… fix, telemetry spans
- Add InferDurableAgentTools and InferDurableAgentUIMessage type helpers (#1302)
- Support prepareStep on DurableAgent constructor with stream-level override (#1303)
- Fix AI_DownloadError for image URLs by defaulting to no-op download (#1376)
- Add telemetry span support (ai.streamText.doStream, ai.toolCall) via optional @opentelemetry/api (#1296)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@VaguelySerious
VaguelySerious requested a review from a team as a code ownerMarch 14, 2026 00:18
@changeset-bot

changeset-botBot commented Mar 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 094fe61

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

This PR includes changesets to release 1 package
NameType
@workflow/aiPatch

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

vercelBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production747067814
✅ 💻 Local Development7700118888
✅ 📦 Local Production7700118888
✅ 🐘 Local Postgres7700118888
✅ 🪟 Windows710374
❌ 🌍 Community Worlds1165515186
✅ 📋 Other195027222
Total3439554663960

❌ Failed Tests

🌍 Community Worlds (55 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

turso (50 failed):

  • addTenWorkflow
  • addTenWorkflow
  • wellKnownAgentWorkflow (.well-known/agent)
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • importedStepOnlyWorkflow
  • hookWorkflow
  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • 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()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • 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
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control)

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6707
✅ example6707
✅ express6707
✅ fastify6707
✅ hono6707
✅ nextjs-turbopack7202
✅ nextjs-webpack7202
✅ nitro6707
✅ nuxt6707
✅ sveltekit6707
✅ vite6707
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7103
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5133
✅ redis-dev302
❌ redis5223
✅ turso-dev302
❌ turso4503
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6509
✅ e2e-local-postgres-nest-stable6509
✅ e2e-local-prod-nest-stable6509

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.039s (-8.7% 🟢)1.006s (~)0.967s101.00x
💻 LocalExpress0.046s (+2.0%)1.005s (-2.0%)0.960s101.18x
💻 LocalNext.js (Turbopack)0.049s1.005s0.956s101.27x
🌐 RedisNext.js (Turbopack)0.054s1.005s0.952s101.39x
🐘 PostgresNext.js (Turbopack)0.061s1.011s0.950s101.57x
🐘 PostgresExpress0.063s (-1.1%)1.012s (~)0.949s101.62x
🐘 PostgresNitro0.067s (+7.7% 🔺)1.017s (+0.5%)0.950s101.74x
🌐 MongoDBNext.js (Turbopack)0.132s1.007s0.876s103.40x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.432s (-54.7% 🟢)2.416s (-18.6% 🟢)1.985s101.00x
▲ VercelExpress0.473s (+1.2%)2.454s (-10.0% 🟢)1.980s101.10x
▲ VercelNitro0.486s (-28.1% 🟢)2.572s (+3.6%)2.085s101.13x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.097s (-2.4%)2.006s (~)0.909s101.00x
💻 LocalNext.js (Turbopack)1.116s2.005s0.889s101.02x
🌐 RedisNext.js (Turbopack)1.132s2.007s0.875s101.03x
💻 LocalExpress1.135s (+1.0%)2.007s (~)0.871s101.04x
🐘 PostgresNext.js (Turbopack)1.146s2.012s0.866s101.05x
🐘 PostgresExpress1.146s (~)2.011s (~)0.865s101.05x
🐘 PostgresNitro1.147s (~)2.013s (~)0.865s101.05x
🌐 MongoDBNext.js (Turbopack)1.306s2.009s0.703s101.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.024s (-5.8% 🟢)3.561s (-6.7% 🟢)1.537s101.00x
▲ VercelExpress2.054s (-1.0%)3.521s (-3.3%)1.467s101.01x
▲ VercelNitro2.169s (-16.8% 🟢)3.862s (-17.8% 🟢)1.693s101.07x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.630s (-2.5%)11.024s (~)0.394s31.00x
💻 LocalNext.js (Turbopack)10.802s11.023s0.221s31.02x
🌐 RedisNext.js (Turbopack)10.812s11.023s0.211s31.02x
🐘 PostgresNext.js (Turbopack)10.836s11.037s0.202s31.02x
💻 LocalExpress10.902s (~)11.024s (~)0.122s31.03x
🐘 PostgresExpress10.932s (~)11.038s (~)0.106s31.03x
🐘 PostgresNitro10.939s (~)11.039s (~)0.100s31.03x
🌐 MongoDBNext.js (Turbopack)12.271s13.022s0.751s31.15x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express16.422s (-3.1%)17.403s (-4.7%)0.981s21.00x
▲ VercelNitro16.722s (-4.4%)18.741s (-7.7% 🟢)2.019s21.02x
▲ VercelNext.js (Turbopack)18.961s (+8.2% 🔺)20.762s (+8.0% 🔺)1.801s21.15x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro26.775s (-2.5%)27.053s (-3.6%)0.278s31.00x
🌐 RedisNext.js (Turbopack)26.787s27.052s0.265s31.00x
🐘 PostgresNext.js (Turbopack)27.016s27.395s0.379s31.01x
🐘 PostgresExpress27.132s (~)27.727s (-1.2%)0.595s31.01x
🐘 PostgresNitro27.235s (~)28.063s (~)0.828s31.02x
💻 LocalNext.js (Turbopack)27.255s28.054s0.799s31.02x
💻 LocalExpress27.513s (~)28.053s (~)0.540s31.03x
🌐 MongoDBNext.js (Turbopack)30.389s31.037s0.649s21.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)45.154s (+2.7%)47.613s (+2.5%)2.459s21.00x
▲ VercelExpress45.218s (+3.1%)46.945s (+2.1%)1.727s21.00x
▲ VercelNitro45.293s (+4.1%)46.791s (+2.7%)1.498s21.00x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)53.414s54.097s0.683s21.00x
🐘 PostgresNext.js (Turbopack)53.876s54.094s0.218s21.01x
🐘 PostgresNitro54.282s (~)55.097s (~)0.815s21.02x
🐘 PostgresExpress54.301s (~)55.100s (~)0.799s21.02x
💻 LocalNitro54.970s (-3.0%)55.107s (-3.5%)0.137s21.03x
💻 LocalNext.js (Turbopack)55.942s56.100s0.158s21.05x
💻 LocalExpress56.868s (~)57.102s (~)0.234s21.06x
🌐 MongoDBNext.js (Turbopack)60.595s61.067s0.472s21.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)93.323s (-3.2%)94.121s (-4.5%)0.798s11.00x
▲ VercelExpress94.753s (+2.1%)97.186s (+3.1%)2.433s11.02x
▲ VercelNitro97.185s (+1.5%)98.493s (+0.6%)1.308s11.04x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.395s2.006s0.612s151.00x
🐘 PostgresNitro1.406s (-2.5%)2.010s (~)0.605s151.01x
🐘 PostgresExpress1.426s (-3.8%)2.010s (~)0.584s151.02x
🐘 PostgresNext.js (Turbopack)1.448s2.011s0.563s151.04x
💻 LocalNitro1.503s (+0.8%)2.005s (~)0.502s151.08x
💻 LocalNext.js (Turbopack)1.539s2.005s0.466s151.10x
💻 LocalExpress1.564s (+5.7% 🔺)2.006s (~)0.442s151.12x
🌐 MongoDBNext.js (Turbopack)2.159s3.008s0.850s101.55x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.150s (-6.1% 🟢)3.703s (-5.5% 🟢)1.553s91.00x
▲ VercelNext.js (Turbopack)2.251s (-10.5% 🟢)4.018s (-1.9%)1.768s81.05x
▲ VercelNitro2.305s (-14.9% 🟢)3.938s (-10.2% 🟢)1.633s81.07x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.566s (-1.4%)3.013s (~)0.447s101.00x
🌐 RedisNext.js (Turbopack)2.582s3.009s0.427s101.01x
🐘 PostgresNitro2.595s (~)3.012s (~)0.417s101.01x
💻 LocalNitro2.637s (-7.7% 🟢)3.007s (-10.0% 🟢)0.370s101.03x
💻 LocalNext.js (Turbopack)2.751s3.107s0.356s101.07x
🐘 PostgresNext.js (Turbopack)2.759s3.213s0.454s101.08x
💻 LocalExpress2.978s (+0.7%)3.564s (+7.7% 🔺)0.586s91.16x
🌐 MongoDBNext.js (Turbopack)4.670s5.177s0.507s61.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.567s (-4.4%)4.252s (+2.1%)1.685s81.00x
▲ VercelExpress2.843s (+12.8% 🔺)3.944s (-10.1% 🟢)1.100s81.11x
▲ VercelNext.js (Turbopack)2.890s (+8.4% 🔺)4.524s (-2.4%)1.635s71.13x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.916s (-1.8%)4.444s (-6.1% 🟢)0.528s71.00x
🐘 PostgresExpress4.020s (+0.7%)4.446s (~)0.426s71.03x
🌐 RedisNext.js (Turbopack)4.133s5.013s0.880s61.06x
🐘 PostgresNext.js (Turbopack)4.540s5.017s0.477s61.16x
💻 LocalNitro7.038s (-13.8% 🟢)7.416s (-17.8% 🟢)0.378s51.80x
💻 LocalNext.js (Turbopack)7.244s7.516s0.273s41.85x
💻 LocalExpress8.511s (+4.4%)9.022s (+2.9%)0.510s42.17x
🌐 MongoDBNext.js (Turbopack)9.758s10.348s0.590s32.49x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.898s (-15.7% 🟢)4.312s (-16.1% 🟢)1.413s71.00x
▲ VercelNitro3.676s (+20.1% 🔺)5.290s (+15.7% 🔺)1.614s61.27x
▲ VercelNext.js (Turbopack)3.739s (-1.7%)5.321s (-3.6%)1.583s61.29x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.330s2.007s0.676s151.00x
🐘 PostgresNitro1.407s (-1.0%)2.010s (~)0.603s151.06x
🐘 PostgresNext.js (Turbopack)1.437s2.011s0.574s151.08x
💻 LocalNitro1.477s (-3.6%)2.005s (~)0.528s151.11x
🐘 PostgresExpress1.496s (+8.1% 🔺)2.077s (+3.3%)0.581s151.12x
💻 LocalNext.js (Turbopack)1.531s2.005s0.475s151.15x
💻 LocalExpress1.539s (+0.5%)2.005s (~)0.466s151.16x
🌐 MongoDBNext.js (Turbopack)2.196s3.009s0.813s101.65x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.185s (-16.2% 🟢)3.438s (-22.8% 🟢)1.253s91.00x
▲ VercelNext.js (Turbopack)2.375s (+6.5% 🔺)3.752s (~)1.376s81.09x
▲ VercelNitro2.386s (+1.1%)4.575s (+0.6%)2.189s71.09x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.484s (-6.7% 🟢)3.010s (-3.3%)0.526s101.00x
🌐 RedisNext.js (Turbopack)2.560s3.008s0.448s101.03x
🐘 PostgresNext.js (Turbopack)2.564s3.012s0.448s101.03x
🐘 PostgresExpress2.609s (+3.7%)3.012s (~)0.403s101.05x
💻 LocalNitro2.707s (-11.3% 🟢)3.009s (-22.6% 🟢)0.302s101.09x
💻 LocalExpress3.041s (+1.7%)3.886s (+9.0% 🔺)0.845s81.22x
💻 LocalNext.js (Turbopack)3.070s3.759s0.689s81.24x
🌐 MongoDBNext.js (Turbopack)4.662s5.177s0.516s61.88x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.259s (-18.2% 🟢)3.694s (-9.9% 🟢)1.435s91.00x
▲ VercelNitro2.624s (+9.4% 🔺)4.394s (+8.4% 🔺)1.770s71.16x
▲ VercelNext.js (Turbopack)2.669s (+6.8% 🔺)4.250s (+6.8% 🔺)1.582s81.18x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.911s (-1.1%)4.590s (~)0.679s71.00x
🐘 PostgresNitro3.950s (-3.3%)4.588s (+3.2%)0.638s71.01x
🌐 RedisNext.js (Turbopack)4.255s5.011s0.756s61.09x
🐘 PostgresNext.js (Turbopack)4.556s5.021s0.466s61.16x
💻 LocalNitro7.397s (-20.4% 🟢)8.019s (-20.0% 🟢)0.622s41.89x
💻 LocalNext.js (Turbopack)8.347s8.767s0.420s42.13x
💻 LocalExpress8.882s (+1.7%)9.270s (+2.8%)0.388s42.27x
🌐 MongoDBNext.js (Turbopack)9.824s10.347s0.523s32.51x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.719s (-1.6%)4.485s (+10.9% 🔺)1.767s71.00x
▲ VercelNitro3.158s (+18.9% 🔺)4.745s (+21.7% 🔺)1.587s71.16x
▲ VercelNext.js (Turbopack)3.199s (-10.0% 🟢)5.271s (-3.5%)2.073s61.18x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.138s (-30.2% 🟢)1.003s (~)0.009s (-18.8% 🟢)1.016s (~)0.877s101.00x
🌐 RedisNext.js (Turbopack)0.175s1.000s0.001s1.008s0.833s101.26x
💻 LocalNext.js (Turbopack)0.178s1.001s0.011s1.017s0.839s101.29x
🐘 PostgresNext.js (Turbopack)0.198s1.002s0.001s1.013s0.815s101.43x
💻 LocalExpress0.207s (+6.1% 🔺)1.003s (~)0.012s (+7.0% 🔺)1.019s (~)0.812s101.49x
🐘 PostgresNitro0.213s (-3.7%)0.997s (~)0.002s (+15.4% 🔺)1.012s (~)0.799s101.54x
🐘 PostgresExpress0.218s (-1.6%)0.993s (~)0.002s (+25.0% 🔺)1.012s (~)0.794s101.58x
🌐 MongoDBNext.js (Turbopack)0.524s0.929s0.001s1.009s0.485s103.78x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.689s (-1.6%)2.686s (-1.1%)0.005s (~)3.325s (-5.4% 🟢)1.636s101.00x
▲ VercelExpress1.716s (-9.3% 🟢)2.758s (+21.0% 🔺)0.010s (+60.9% 🔺)3.369s (+6.1% 🔺)1.653s101.02x
▲ VercelNitro1.774s (+11.2% 🔺)2.720s (+1.0%)0.005s (-96.4% 🟢)3.297s (-3.6%)1.523s101.05x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro12/12
🐘 PostgresNext.js (Turbopack)6/12
▲ VercelExpress6/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres5/12
Next.js (Turbopack)🌐 Redis7/12
Nitro💻 Local5/12
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)

📋 View full workflow run

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Comment threadpackages/ai/src/agent/do-stream-step.ts
- Use space separator in operation.name (not dot) to match AI SDK
- Add resource.name attribute from functionId
- Use recordException() + setStatus() for error spans (preserves stack traces)
- Add context.with() for proper parent-child span propagation
- Make recordSpan self-initializing (remove initTelemetry two-phase requirement)
- Add recordInputs/recordOutputs to TelemetrySettings for sensitive data gating
- Add gen_ai.* semantic convention attributes to doStream span
- Add ai.toolCall.args gated by recordOutputs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Convert contextStorage AsyncLocalStorage from module-scoped to a
globalThis singleton using Symbol.for(). This prevents esbuild's
module scope duplication from creating separate ALS instances, which
caused AsyncLocalStorage.getStore() to return undefined inside tool
execute() callbacks.
Cherry-picked from 8ea3f89 (peter/v2-flow), excluding unrelated
v2-flow runtime changes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread.changeset/durable-agent-improvements.md Outdated
VaguelySeriousand others added 5 commits March 16, 2026 15:52
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Next.js 16.2.0-canary.100+ has a regression where @workflow/ai step
files are missing from the step bundle, causing "doStreamStep not
found" errors that hang the agent tests until timeout.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
DEV_TEST_CONFIG was only set in the dev test job, so prod and postgres
canary jobs didn't skip agent tests. Add NEXT_CANARY env var to all
three local e2e test jobs (dev, prod, postgres) and use it directly.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@karthikscale3karthikscale3 left a comment

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.

Changes look good to me.

  • o11y reporting matches 1:1 to aisdk
  • prepareStep addition looks good

@pranaygppranaygp left a comment

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.

we should really update the e2e tests and the DurableAgent/ToolLoopAgent integration compat tests to prevent regressions here and to validate tat the features actually work

thank you so much!!

VaguelySeriousand others added 5 commits March 16, 2026 17:07
- agentConstructorPrepareStepE2e: verifies agent-level prepareStep is
called for each LLM step through the full workflow runtime
- agentStreamPrepareStepOverrideE2e: verifies stream-level prepareStep
overrides constructor-level
- agentMultimodalToolResultE2e: verifies tools returning
LanguageModelV3ToolResultOutput (type: 'content') pass through the
serialization/deserialization boundary correctly
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add three tests to the ToolLoopAgent compat suite verifying:
- Constructor-level prepareStep is called on each LLM step
- Stream-level prepareStep overrides constructor-level
- Constructor prepareStep fires for every step in multi-step tool loops
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
prepareStep: ({ stepNumber }) => {
stepNumbers.push(stepNumber);
return {};
},

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.

I'm curious if prepareStep is typically used as a step function, or used inline in the workflow context itself?

I did a quick scan on AI sdk docs and looks like your example is exactly what it's typically used for :)

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 action needed - just curious

{ type: 'text', text: 'Here is the image' },
{ type: 'file-data', data: 'iVBORw0KGgo=', mediaType: 'image/png' },
],
};

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.

https://ai-sdk.dev/docs/ai-sdk-core/tools-and-tool-calling#multi-modal-tool-results

nit: should we actually use toModelOutput? looks like that's the intended way to use it since tool authors typically wouldn't write a tool to return in the model message format, but would use the converter

just to make the e2e tests more real? claude, you might want to validate that ToolLoopAgent also propagates this toModelOutput since that example was taken from generateText

@pranaygppranaygp left a comment

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.

lgtm - thanks for adding the tests. left some comments :)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants

@VaguelySerious@pranaygp@karthikscale3
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' DurableAgent: various compatibility fixes by VaguelySerious · Pull Request #1385 · vercel/workflow · GitHub
Skip to content

DurableAgent: various compatibility fixes - #1385

Merged
VaguelySerious merged 18 commits into
mainfrom
peter/combined-durable-agent-fixes
Mar 17, 2026
Merged

DurableAgent: various compatibility fixes#1385
VaguelySerious merged 18 commits into
mainfrom
peter/combined-durable-agent-fixes

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 14, 2026

Copy link
Copy Markdown
Member

Closes#1303 : Support prepareStep on DurableAgent constructor with stream-level override
Closes#1302 : Add InferDurableAgentTools and InferDurableAgentUIMessage type helpers
Closes#1376 : Fix AI_DownloadError for image URLs by defaulting to no-op download
Closes#1296 : Add telemetry span support (ai.streamText.doStream, ai.toolCall) via optional @opentelemetry/api
Closes#848: Allow LanguageModelV3ToolResultOutput results to pass through without json parsin
Closes#975: Documents the necessity of sendStart: false when writing custom UIMessageChunks

Co-Authored-By: @nicoalbanese

… fix, telemetry spans
- Add InferDurableAgentTools and InferDurableAgentUIMessage type helpers (#1302)
- Support prepareStep on DurableAgent constructor with stream-level override (#1303)
- Fix AI_DownloadError for image URLs by defaulting to no-op download (#1376)
- Add telemetry span support (ai.streamText.doStream, ai.toolCall) via optional @opentelemetry/api (#1296)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@VaguelySerious
VaguelySerious requested a review from a team as a code ownerMarch 14, 2026 00:18
@changeset-bot

changeset-botBot commented Mar 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 094fe61

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

This PR includes changesets to release 1 package
NameType
@workflow/aiPatch

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

vercelBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production747067814
✅ 💻 Local Development7700118888
✅ 📦 Local Production7700118888
✅ 🐘 Local Postgres7700118888
✅ 🪟 Windows710374
❌ 🌍 Community Worlds1165515186
✅ 📋 Other195027222
Total3439554663960

❌ Failed Tests

🌍 Community Worlds (55 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

turso (50 failed):

  • addTenWorkflow
  • addTenWorkflow
  • wellKnownAgentWorkflow (.well-known/agent)
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • importedStepOnlyWorkflow
  • hookWorkflow
  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • 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()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • 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
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control)

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6707
✅ example6707
✅ express6707
✅ fastify6707
✅ hono6707
✅ nextjs-turbopack7202
✅ nextjs-webpack7202
✅ nitro6707
✅ nuxt6707
✅ sveltekit6707
✅ vite6707
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7103
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5133
✅ redis-dev302
❌ redis5223
✅ turso-dev302
❌ turso4503
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6509
✅ e2e-local-postgres-nest-stable6509
✅ e2e-local-prod-nest-stable6509

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.039s (-8.7% 🟢)1.006s (~)0.967s101.00x
💻 LocalExpress0.046s (+2.0%)1.005s (-2.0%)0.960s101.18x
💻 LocalNext.js (Turbopack)0.049s1.005s0.956s101.27x
🌐 RedisNext.js (Turbopack)0.054s1.005s0.952s101.39x
🐘 PostgresNext.js (Turbopack)0.061s1.011s0.950s101.57x
🐘 PostgresExpress0.063s (-1.1%)1.012s (~)0.949s101.62x
🐘 PostgresNitro0.067s (+7.7% 🔺)1.017s (+0.5%)0.950s101.74x
🌐 MongoDBNext.js (Turbopack)0.132s1.007s0.876s103.40x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.432s (-54.7% 🟢)2.416s (-18.6% 🟢)1.985s101.00x
▲ VercelExpress0.473s (+1.2%)2.454s (-10.0% 🟢)1.980s101.10x
▲ VercelNitro0.486s (-28.1% 🟢)2.572s (+3.6%)2.085s101.13x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.097s (-2.4%)2.006s (~)0.909s101.00x
💻 LocalNext.js (Turbopack)1.116s2.005s0.889s101.02x
🌐 RedisNext.js (Turbopack)1.132s2.007s0.875s101.03x
💻 LocalExpress1.135s (+1.0%)2.007s (~)0.871s101.04x
🐘 PostgresNext.js (Turbopack)1.146s2.012s0.866s101.05x
🐘 PostgresExpress1.146s (~)2.011s (~)0.865s101.05x
🐘 PostgresNitro1.147s (~)2.013s (~)0.865s101.05x
🌐 MongoDBNext.js (Turbopack)1.306s2.009s0.703s101.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.024s (-5.8% 🟢)3.561s (-6.7% 🟢)1.537s101.00x
▲ VercelExpress2.054s (-1.0%)3.521s (-3.3%)1.467s101.01x
▲ VercelNitro2.169s (-16.8% 🟢)3.862s (-17.8% 🟢)1.693s101.07x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.630s (-2.5%)11.024s (~)0.394s31.00x
💻 LocalNext.js (Turbopack)10.802s11.023s0.221s31.02x
🌐 RedisNext.js (Turbopack)10.812s11.023s0.211s31.02x
🐘 PostgresNext.js (Turbopack)10.836s11.037s0.202s31.02x
💻 LocalExpress10.902s (~)11.024s (~)0.122s31.03x
🐘 PostgresExpress10.932s (~)11.038s (~)0.106s31.03x
🐘 PostgresNitro10.939s (~)11.039s (~)0.100s31.03x
🌐 MongoDBNext.js (Turbopack)12.271s13.022s0.751s31.15x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express16.422s (-3.1%)17.403s (-4.7%)0.981s21.00x
▲ VercelNitro16.722s (-4.4%)18.741s (-7.7% 🟢)2.019s21.02x
▲ VercelNext.js (Turbopack)18.961s (+8.2% 🔺)20.762s (+8.0% 🔺)1.801s21.15x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro26.775s (-2.5%)27.053s (-3.6%)0.278s31.00x
🌐 RedisNext.js (Turbopack)26.787s27.052s0.265s31.00x
🐘 PostgresNext.js (Turbopack)27.016s27.395s0.379s31.01x
🐘 PostgresExpress27.132s (~)27.727s (-1.2%)0.595s31.01x
🐘 PostgresNitro27.235s (~)28.063s (~)0.828s31.02x
💻 LocalNext.js (Turbopack)27.255s28.054s0.799s31.02x
💻 LocalExpress27.513s (~)28.053s (~)0.540s31.03x
🌐 MongoDBNext.js (Turbopack)30.389s31.037s0.649s21.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)45.154s (+2.7%)47.613s (+2.5%)2.459s21.00x
▲ VercelExpress45.218s (+3.1%)46.945s (+2.1%)1.727s21.00x
▲ VercelNitro45.293s (+4.1%)46.791s (+2.7%)1.498s21.00x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)53.414s54.097s0.683s21.00x
🐘 PostgresNext.js (Turbopack)53.876s54.094s0.218s21.01x
🐘 PostgresNitro54.282s (~)55.097s (~)0.815s21.02x
🐘 PostgresExpress54.301s (~)55.100s (~)0.799s21.02x
💻 LocalNitro54.970s (-3.0%)55.107s (-3.5%)0.137s21.03x
💻 LocalNext.js (Turbopack)55.942s56.100s0.158s21.05x
💻 LocalExpress56.868s (~)57.102s (~)0.234s21.06x
🌐 MongoDBNext.js (Turbopack)60.595s61.067s0.472s21.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)93.323s (-3.2%)94.121s (-4.5%)0.798s11.00x
▲ VercelExpress94.753s (+2.1%)97.186s (+3.1%)2.433s11.02x
▲ VercelNitro97.185s (+1.5%)98.493s (+0.6%)1.308s11.04x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.395s2.006s0.612s151.00x
🐘 PostgresNitro1.406s (-2.5%)2.010s (~)0.605s151.01x
🐘 PostgresExpress1.426s (-3.8%)2.010s (~)0.584s151.02x
🐘 PostgresNext.js (Turbopack)1.448s2.011s0.563s151.04x
💻 LocalNitro1.503s (+0.8%)2.005s (~)0.502s151.08x
💻 LocalNext.js (Turbopack)1.539s2.005s0.466s151.10x
💻 LocalExpress1.564s (+5.7% 🔺)2.006s (~)0.442s151.12x
🌐 MongoDBNext.js (Turbopack)2.159s3.008s0.850s101.55x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.150s (-6.1% 🟢)3.703s (-5.5% 🟢)1.553s91.00x
▲ VercelNext.js (Turbopack)2.251s (-10.5% 🟢)4.018s (-1.9%)1.768s81.05x
▲ VercelNitro2.305s (-14.9% 🟢)3.938s (-10.2% 🟢)1.633s81.07x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.566s (-1.4%)3.013s (~)0.447s101.00x
🌐 RedisNext.js (Turbopack)2.582s3.009s0.427s101.01x
🐘 PostgresNitro2.595s (~)3.012s (~)0.417s101.01x
💻 LocalNitro2.637s (-7.7% 🟢)3.007s (-10.0% 🟢)0.370s101.03x
💻 LocalNext.js (Turbopack)2.751s3.107s0.356s101.07x
🐘 PostgresNext.js (Turbopack)2.759s3.213s0.454s101.08x
💻 LocalExpress2.978s (+0.7%)3.564s (+7.7% 🔺)0.586s91.16x
🌐 MongoDBNext.js (Turbopack)4.670s5.177s0.507s61.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.567s (-4.4%)4.252s (+2.1%)1.685s81.00x
▲ VercelExpress2.843s (+12.8% 🔺)3.944s (-10.1% 🟢)1.100s81.11x
▲ VercelNext.js (Turbopack)2.890s (+8.4% 🔺)4.524s (-2.4%)1.635s71.13x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.916s (-1.8%)4.444s (-6.1% 🟢)0.528s71.00x
🐘 PostgresExpress4.020s (+0.7%)4.446s (~)0.426s71.03x
🌐 RedisNext.js (Turbopack)4.133s5.013s0.880s61.06x
🐘 PostgresNext.js (Turbopack)4.540s5.017s0.477s61.16x
💻 LocalNitro7.038s (-13.8% 🟢)7.416s (-17.8% 🟢)0.378s51.80x
💻 LocalNext.js (Turbopack)7.244s7.516s0.273s41.85x
💻 LocalExpress8.511s (+4.4%)9.022s (+2.9%)0.510s42.17x
🌐 MongoDBNext.js (Turbopack)9.758s10.348s0.590s32.49x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.898s (-15.7% 🟢)4.312s (-16.1% 🟢)1.413s71.00x
▲ VercelNitro3.676s (+20.1% 🔺)5.290s (+15.7% 🔺)1.614s61.27x
▲ VercelNext.js (Turbopack)3.739s (-1.7%)5.321s (-3.6%)1.583s61.29x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.330s2.007s0.676s151.00x
🐘 PostgresNitro1.407s (-1.0%)2.010s (~)0.603s151.06x
🐘 PostgresNext.js (Turbopack)1.437s2.011s0.574s151.08x
💻 LocalNitro1.477s (-3.6%)2.005s (~)0.528s151.11x
🐘 PostgresExpress1.496s (+8.1% 🔺)2.077s (+3.3%)0.581s151.12x
💻 LocalNext.js (Turbopack)1.531s2.005s0.475s151.15x
💻 LocalExpress1.539s (+0.5%)2.005s (~)0.466s151.16x
🌐 MongoDBNext.js (Turbopack)2.196s3.009s0.813s101.65x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.185s (-16.2% 🟢)3.438s (-22.8% 🟢)1.253s91.00x
▲ VercelNext.js (Turbopack)2.375s (+6.5% 🔺)3.752s (~)1.376s81.09x
▲ VercelNitro2.386s (+1.1%)4.575s (+0.6%)2.189s71.09x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.484s (-6.7% 🟢)3.010s (-3.3%)0.526s101.00x
🌐 RedisNext.js (Turbopack)2.560s3.008s0.448s101.03x
🐘 PostgresNext.js (Turbopack)2.564s3.012s0.448s101.03x
🐘 PostgresExpress2.609s (+3.7%)3.012s (~)0.403s101.05x
💻 LocalNitro2.707s (-11.3% 🟢)3.009s (-22.6% 🟢)0.302s101.09x
💻 LocalExpress3.041s (+1.7%)3.886s (+9.0% 🔺)0.845s81.22x
💻 LocalNext.js (Turbopack)3.070s3.759s0.689s81.24x
🌐 MongoDBNext.js (Turbopack)4.662s5.177s0.516s61.88x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.259s (-18.2% 🟢)3.694s (-9.9% 🟢)1.435s91.00x
▲ VercelNitro2.624s (+9.4% 🔺)4.394s (+8.4% 🔺)1.770s71.16x
▲ VercelNext.js (Turbopack)2.669s (+6.8% 🔺)4.250s (+6.8% 🔺)1.582s81.18x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.911s (-1.1%)4.590s (~)0.679s71.00x
🐘 PostgresNitro3.950s (-3.3%)4.588s (+3.2%)0.638s71.01x
🌐 RedisNext.js (Turbopack)4.255s5.011s0.756s61.09x
🐘 PostgresNext.js (Turbopack)4.556s5.021s0.466s61.16x
💻 LocalNitro7.397s (-20.4% 🟢)8.019s (-20.0% 🟢)0.622s41.89x
💻 LocalNext.js (Turbopack)8.347s8.767s0.420s42.13x
💻 LocalExpress8.882s (+1.7%)9.270s (+2.8%)0.388s42.27x
🌐 MongoDBNext.js (Turbopack)9.824s10.347s0.523s32.51x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.719s (-1.6%)4.485s (+10.9% 🔺)1.767s71.00x
▲ VercelNitro3.158s (+18.9% 🔺)4.745s (+21.7% 🔺)1.587s71.16x
▲ VercelNext.js (Turbopack)3.199s (-10.0% 🟢)5.271s (-3.5%)2.073s61.18x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.138s (-30.2% 🟢)1.003s (~)0.009s (-18.8% 🟢)1.016s (~)0.877s101.00x
🌐 RedisNext.js (Turbopack)0.175s1.000s0.001s1.008s0.833s101.26x
💻 LocalNext.js (Turbopack)0.178s1.001s0.011s1.017s0.839s101.29x
🐘 PostgresNext.js (Turbopack)0.198s1.002s0.001s1.013s0.815s101.43x
💻 LocalExpress0.207s (+6.1% 🔺)1.003s (~)0.012s (+7.0% 🔺)1.019s (~)0.812s101.49x
🐘 PostgresNitro0.213s (-3.7%)0.997s (~)0.002s (+15.4% 🔺)1.012s (~)0.799s101.54x
🐘 PostgresExpress0.218s (-1.6%)0.993s (~)0.002s (+25.0% 🔺)1.012s (~)0.794s101.58x
🌐 MongoDBNext.js (Turbopack)0.524s0.929s0.001s1.009s0.485s103.78x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.689s (-1.6%)2.686s (-1.1%)0.005s (~)3.325s (-5.4% 🟢)1.636s101.00x
▲ VercelExpress1.716s (-9.3% 🟢)2.758s (+21.0% 🔺)0.010s (+60.9% 🔺)3.369s (+6.1% 🔺)1.653s101.02x
▲ VercelNitro1.774s (+11.2% 🔺)2.720s (+1.0%)0.005s (-96.4% 🟢)3.297s (-3.6%)1.523s101.05x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro12/12
🐘 PostgresNext.js (Turbopack)6/12
▲ VercelExpress6/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres5/12
Next.js (Turbopack)🌐 Redis7/12
Nitro💻 Local5/12
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)

📋 View full workflow run

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Comment threadpackages/ai/src/agent/do-stream-step.ts
- Use space separator in operation.name (not dot) to match AI SDK
- Add resource.name attribute from functionId
- Use recordException() + setStatus() for error spans (preserves stack traces)
- Add context.with() for proper parent-child span propagation
- Make recordSpan self-initializing (remove initTelemetry two-phase requirement)
- Add recordInputs/recordOutputs to TelemetrySettings for sensitive data gating
- Add gen_ai.* semantic convention attributes to doStream span
- Add ai.toolCall.args gated by recordOutputs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Convert contextStorage AsyncLocalStorage from module-scoped to a
globalThis singleton using Symbol.for(). This prevents esbuild's
module scope duplication from creating separate ALS instances, which
caused AsyncLocalStorage.getStore() to return undefined inside tool
execute() callbacks.
Cherry-picked from 8ea3f89 (peter/v2-flow), excluding unrelated
v2-flow runtime changes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread.changeset/durable-agent-improvements.md Outdated
VaguelySeriousand others added 5 commits March 16, 2026 15:52
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Next.js 16.2.0-canary.100+ has a regression where @workflow/ai step
files are missing from the step bundle, causing "doStreamStep not
found" errors that hang the agent tests until timeout.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
DEV_TEST_CONFIG was only set in the dev test job, so prod and postgres
canary jobs didn't skip agent tests. Add NEXT_CANARY env var to all
three local e2e test jobs (dev, prod, postgres) and use it directly.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@karthikscale3karthikscale3 left a comment

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.

Changes look good to me.

  • o11y reporting matches 1:1 to aisdk
  • prepareStep addition looks good

@pranaygppranaygp left a comment

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.

we should really update the e2e tests and the DurableAgent/ToolLoopAgent integration compat tests to prevent regressions here and to validate tat the features actually work

thank you so much!!

VaguelySeriousand others added 5 commits March 16, 2026 17:07
- agentConstructorPrepareStepE2e: verifies agent-level prepareStep is
called for each LLM step through the full workflow runtime
- agentStreamPrepareStepOverrideE2e: verifies stream-level prepareStep
overrides constructor-level
- agentMultimodalToolResultE2e: verifies tools returning
LanguageModelV3ToolResultOutput (type: 'content') pass through the
serialization/deserialization boundary correctly
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add three tests to the ToolLoopAgent compat suite verifying:
- Constructor-level prepareStep is called on each LLM step
- Stream-level prepareStep overrides constructor-level
- Constructor prepareStep fires for every step in multi-step tool loops
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
prepareStep: ({ stepNumber }) => {
stepNumbers.push(stepNumber);
return {};
},

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.

I'm curious if prepareStep is typically used as a step function, or used inline in the workflow context itself?

I did a quick scan on AI sdk docs and looks like your example is exactly what it's typically used for :)

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 action needed - just curious

{ type: 'text', text: 'Here is the image' },
{ type: 'file-data', data: 'iVBORw0KGgo=', mediaType: 'image/png' },
],
};

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.

https://ai-sdk.dev/docs/ai-sdk-core/tools-and-tool-calling#multi-modal-tool-results

nit: should we actually use toModelOutput? looks like that's the intended way to use it since tool authors typically wouldn't write a tool to return in the model message format, but would use the converter

just to make the e2e tests more real? claude, you might want to validate that ToolLoopAgent also propagates this toModelOutput since that example was taken from generateText

@pranaygppranaygp left a comment

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.

lgtm - thanks for adding the tests. left some comments :)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants

@VaguelySerious@pranaygp@karthikscale3
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' DurableAgent: various compatibility fixes by VaguelySerious · Pull Request #1385 · vercel/workflow · GitHub
Skip to content

DurableAgent: various compatibility fixes - #1385

Merged
VaguelySerious merged 18 commits into
mainfrom
peter/combined-durable-agent-fixes
Mar 17, 2026
Merged

DurableAgent: various compatibility fixes#1385
VaguelySerious merged 18 commits into
mainfrom
peter/combined-durable-agent-fixes

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 14, 2026

Copy link
Copy Markdown
Member

Closes#1303 : Support prepareStep on DurableAgent constructor with stream-level override
Closes#1302 : Add InferDurableAgentTools and InferDurableAgentUIMessage type helpers
Closes#1376 : Fix AI_DownloadError for image URLs by defaulting to no-op download
Closes#1296 : Add telemetry span support (ai.streamText.doStream, ai.toolCall) via optional @opentelemetry/api
Closes#848: Allow LanguageModelV3ToolResultOutput results to pass through without json parsin
Closes#975: Documents the necessity of sendStart: false when writing custom UIMessageChunks

Co-Authored-By: @nicoalbanese

… fix, telemetry spans
- Add InferDurableAgentTools and InferDurableAgentUIMessage type helpers (#1302)
- Support prepareStep on DurableAgent constructor with stream-level override (#1303)
- Fix AI_DownloadError for image URLs by defaulting to no-op download (#1376)
- Add telemetry span support (ai.streamText.doStream, ai.toolCall) via optional @opentelemetry/api (#1296)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@VaguelySerious
VaguelySerious requested a review from a team as a code ownerMarch 14, 2026 00:18
@changeset-bot

changeset-botBot commented Mar 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 094fe61

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

This PR includes changesets to release 1 package
NameType
@workflow/aiPatch

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

vercelBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production747067814
✅ 💻 Local Development7700118888
✅ 📦 Local Production7700118888
✅ 🐘 Local Postgres7700118888
✅ 🪟 Windows710374
❌ 🌍 Community Worlds1165515186
✅ 📋 Other195027222
Total3439554663960

❌ Failed Tests

🌍 Community Worlds (55 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

turso (50 failed):

  • addTenWorkflow
  • addTenWorkflow
  • wellKnownAgentWorkflow (.well-known/agent)
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • importedStepOnlyWorkflow
  • hookWorkflow
  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • 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()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • 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
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control)

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6707
✅ example6707
✅ express6707
✅ fastify6707
✅ hono6707
✅ nextjs-turbopack7202
✅ nextjs-webpack7202
✅ nitro6707
✅ nuxt6707
✅ sveltekit6707
✅ vite6707
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7103
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5133
✅ redis-dev302
❌ redis5223
✅ turso-dev302
❌ turso4503
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6509
✅ e2e-local-postgres-nest-stable6509
✅ e2e-local-prod-nest-stable6509

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.039s (-8.7% 🟢)1.006s (~)0.967s101.00x
💻 LocalExpress0.046s (+2.0%)1.005s (-2.0%)0.960s101.18x
💻 LocalNext.js (Turbopack)0.049s1.005s0.956s101.27x
🌐 RedisNext.js (Turbopack)0.054s1.005s0.952s101.39x
🐘 PostgresNext.js (Turbopack)0.061s1.011s0.950s101.57x
🐘 PostgresExpress0.063s (-1.1%)1.012s (~)0.949s101.62x
🐘 PostgresNitro0.067s (+7.7% 🔺)1.017s (+0.5%)0.950s101.74x
🌐 MongoDBNext.js (Turbopack)0.132s1.007s0.876s103.40x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.432s (-54.7% 🟢)2.416s (-18.6% 🟢)1.985s101.00x
▲ VercelExpress0.473s (+1.2%)2.454s (-10.0% 🟢)1.980s101.10x
▲ VercelNitro0.486s (-28.1% 🟢)2.572s (+3.6%)2.085s101.13x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.097s (-2.4%)2.006s (~)0.909s101.00x
💻 LocalNext.js (Turbopack)1.116s2.005s0.889s101.02x
🌐 RedisNext.js (Turbopack)1.132s2.007s0.875s101.03x
💻 LocalExpress1.135s (+1.0%)2.007s (~)0.871s101.04x
🐘 PostgresNext.js (Turbopack)1.146s2.012s0.866s101.05x
🐘 PostgresExpress1.146s (~)2.011s (~)0.865s101.05x
🐘 PostgresNitro1.147s (~)2.013s (~)0.865s101.05x
🌐 MongoDBNext.js (Turbopack)1.306s2.009s0.703s101.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.024s (-5.8% 🟢)3.561s (-6.7% 🟢)1.537s101.00x
▲ VercelExpress2.054s (-1.0%)3.521s (-3.3%)1.467s101.01x
▲ VercelNitro2.169s (-16.8% 🟢)3.862s (-17.8% 🟢)1.693s101.07x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.630s (-2.5%)11.024s (~)0.394s31.00x
💻 LocalNext.js (Turbopack)10.802s11.023s0.221s31.02x
🌐 RedisNext.js (Turbopack)10.812s11.023s0.211s31.02x
🐘 PostgresNext.js (Turbopack)10.836s11.037s0.202s31.02x
💻 LocalExpress10.902s (~)11.024s (~)0.122s31.03x
🐘 PostgresExpress10.932s (~)11.038s (~)0.106s31.03x
🐘 PostgresNitro10.939s (~)11.039s (~)0.100s31.03x
🌐 MongoDBNext.js (Turbopack)12.271s13.022s0.751s31.15x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express16.422s (-3.1%)17.403s (-4.7%)0.981s21.00x
▲ VercelNitro16.722s (-4.4%)18.741s (-7.7% 🟢)2.019s21.02x
▲ VercelNext.js (Turbopack)18.961s (+8.2% 🔺)20.762s (+8.0% 🔺)1.801s21.15x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro26.775s (-2.5%)27.053s (-3.6%)0.278s31.00x
🌐 RedisNext.js (Turbopack)26.787s27.052s0.265s31.00x
🐘 PostgresNext.js (Turbopack)27.016s27.395s0.379s31.01x
🐘 PostgresExpress27.132s (~)27.727s (-1.2%)0.595s31.01x
🐘 PostgresNitro27.235s (~)28.063s (~)0.828s31.02x
💻 LocalNext.js (Turbopack)27.255s28.054s0.799s31.02x
💻 LocalExpress27.513s (~)28.053s (~)0.540s31.03x
🌐 MongoDBNext.js (Turbopack)30.389s31.037s0.649s21.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)45.154s (+2.7%)47.613s (+2.5%)2.459s21.00x
▲ VercelExpress45.218s (+3.1%)46.945s (+2.1%)1.727s21.00x
▲ VercelNitro45.293s (+4.1%)46.791s (+2.7%)1.498s21.00x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)53.414s54.097s0.683s21.00x
🐘 PostgresNext.js (Turbopack)53.876s54.094s0.218s21.01x
🐘 PostgresNitro54.282s (~)55.097s (~)0.815s21.02x
🐘 PostgresExpress54.301s (~)55.100s (~)0.799s21.02x
💻 LocalNitro54.970s (-3.0%)55.107s (-3.5%)0.137s21.03x
💻 LocalNext.js (Turbopack)55.942s56.100s0.158s21.05x
💻 LocalExpress56.868s (~)57.102s (~)0.234s21.06x
🌐 MongoDBNext.js (Turbopack)60.595s61.067s0.472s21.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)93.323s (-3.2%)94.121s (-4.5%)0.798s11.00x
▲ VercelExpress94.753s (+2.1%)97.186s (+3.1%)2.433s11.02x
▲ VercelNitro97.185s (+1.5%)98.493s (+0.6%)1.308s11.04x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.395s2.006s0.612s151.00x
🐘 PostgresNitro1.406s (-2.5%)2.010s (~)0.605s151.01x
🐘 PostgresExpress1.426s (-3.8%)2.010s (~)0.584s151.02x
🐘 PostgresNext.js (Turbopack)1.448s2.011s0.563s151.04x
💻 LocalNitro1.503s (+0.8%)2.005s (~)0.502s151.08x
💻 LocalNext.js (Turbopack)1.539s2.005s0.466s151.10x
💻 LocalExpress1.564s (+5.7% 🔺)2.006s (~)0.442s151.12x
🌐 MongoDBNext.js (Turbopack)2.159s3.008s0.850s101.55x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.150s (-6.1% 🟢)3.703s (-5.5% 🟢)1.553s91.00x
▲ VercelNext.js (Turbopack)2.251s (-10.5% 🟢)4.018s (-1.9%)1.768s81.05x
▲ VercelNitro2.305s (-14.9% 🟢)3.938s (-10.2% 🟢)1.633s81.07x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.566s (-1.4%)3.013s (~)0.447s101.00x
🌐 RedisNext.js (Turbopack)2.582s3.009s0.427s101.01x
🐘 PostgresNitro2.595s (~)3.012s (~)0.417s101.01x
💻 LocalNitro2.637s (-7.7% 🟢)3.007s (-10.0% 🟢)0.370s101.03x
💻 LocalNext.js (Turbopack)2.751s3.107s0.356s101.07x
🐘 PostgresNext.js (Turbopack)2.759s3.213s0.454s101.08x
💻 LocalExpress2.978s (+0.7%)3.564s (+7.7% 🔺)0.586s91.16x
🌐 MongoDBNext.js (Turbopack)4.670s5.177s0.507s61.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.567s (-4.4%)4.252s (+2.1%)1.685s81.00x
▲ VercelExpress2.843s (+12.8% 🔺)3.944s (-10.1% 🟢)1.100s81.11x
▲ VercelNext.js (Turbopack)2.890s (+8.4% 🔺)4.524s (-2.4%)1.635s71.13x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.916s (-1.8%)4.444s (-6.1% 🟢)0.528s71.00x
🐘 PostgresExpress4.020s (+0.7%)4.446s (~)0.426s71.03x
🌐 RedisNext.js (Turbopack)4.133s5.013s0.880s61.06x
🐘 PostgresNext.js (Turbopack)4.540s5.017s0.477s61.16x
💻 LocalNitro7.038s (-13.8% 🟢)7.416s (-17.8% 🟢)0.378s51.80x
💻 LocalNext.js (Turbopack)7.244s7.516s0.273s41.85x
💻 LocalExpress8.511s (+4.4%)9.022s (+2.9%)0.510s42.17x
🌐 MongoDBNext.js (Turbopack)9.758s10.348s0.590s32.49x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.898s (-15.7% 🟢)4.312s (-16.1% 🟢)1.413s71.00x
▲ VercelNitro3.676s (+20.1% 🔺)5.290s (+15.7% 🔺)1.614s61.27x
▲ VercelNext.js (Turbopack)3.739s (-1.7%)5.321s (-3.6%)1.583s61.29x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.330s2.007s0.676s151.00x
🐘 PostgresNitro1.407s (-1.0%)2.010s (~)0.603s151.06x
🐘 PostgresNext.js (Turbopack)1.437s2.011s0.574s151.08x
💻 LocalNitro1.477s (-3.6%)2.005s (~)0.528s151.11x
🐘 PostgresExpress1.496s (+8.1% 🔺)2.077s (+3.3%)0.581s151.12x
💻 LocalNext.js (Turbopack)1.531s2.005s0.475s151.15x
💻 LocalExpress1.539s (+0.5%)2.005s (~)0.466s151.16x
🌐 MongoDBNext.js (Turbopack)2.196s3.009s0.813s101.65x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.185s (-16.2% 🟢)3.438s (-22.8% 🟢)1.253s91.00x
▲ VercelNext.js (Turbopack)2.375s (+6.5% 🔺)3.752s (~)1.376s81.09x
▲ VercelNitro2.386s (+1.1%)4.575s (+0.6%)2.189s71.09x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.484s (-6.7% 🟢)3.010s (-3.3%)0.526s101.00x
🌐 RedisNext.js (Turbopack)2.560s3.008s0.448s101.03x
🐘 PostgresNext.js (Turbopack)2.564s3.012s0.448s101.03x
🐘 PostgresExpress2.609s (+3.7%)3.012s (~)0.403s101.05x
💻 LocalNitro2.707s (-11.3% 🟢)3.009s (-22.6% 🟢)0.302s101.09x
💻 LocalExpress3.041s (+1.7%)3.886s (+9.0% 🔺)0.845s81.22x
💻 LocalNext.js (Turbopack)3.070s3.759s0.689s81.24x
🌐 MongoDBNext.js (Turbopack)4.662s5.177s0.516s61.88x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.259s (-18.2% 🟢)3.694s (-9.9% 🟢)1.435s91.00x
▲ VercelNitro2.624s (+9.4% 🔺)4.394s (+8.4% 🔺)1.770s71.16x
▲ VercelNext.js (Turbopack)2.669s (+6.8% 🔺)4.250s (+6.8% 🔺)1.582s81.18x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.911s (-1.1%)4.590s (~)0.679s71.00x
🐘 PostgresNitro3.950s (-3.3%)4.588s (+3.2%)0.638s71.01x
🌐 RedisNext.js (Turbopack)4.255s5.011s0.756s61.09x
🐘 PostgresNext.js (Turbopack)4.556s5.021s0.466s61.16x
💻 LocalNitro7.397s (-20.4% 🟢)8.019s (-20.0% 🟢)0.622s41.89x
💻 LocalNext.js (Turbopack)8.347s8.767s0.420s42.13x
💻 LocalExpress8.882s (+1.7%)9.270s (+2.8%)0.388s42.27x
🌐 MongoDBNext.js (Turbopack)9.824s10.347s0.523s32.51x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.719s (-1.6%)4.485s (+10.9% 🔺)1.767s71.00x
▲ VercelNitro3.158s (+18.9% 🔺)4.745s (+21.7% 🔺)1.587s71.16x
▲ VercelNext.js (Turbopack)3.199s (-10.0% 🟢)5.271s (-3.5%)2.073s61.18x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.138s (-30.2% 🟢)1.003s (~)0.009s (-18.8% 🟢)1.016s (~)0.877s101.00x
🌐 RedisNext.js (Turbopack)0.175s1.000s0.001s1.008s0.833s101.26x
💻 LocalNext.js (Turbopack)0.178s1.001s0.011s1.017s0.839s101.29x
🐘 PostgresNext.js (Turbopack)0.198s1.002s0.001s1.013s0.815s101.43x
💻 LocalExpress0.207s (+6.1% 🔺)1.003s (~)0.012s (+7.0% 🔺)1.019s (~)0.812s101.49x
🐘 PostgresNitro0.213s (-3.7%)0.997s (~)0.002s (+15.4% 🔺)1.012s (~)0.799s101.54x
🐘 PostgresExpress0.218s (-1.6%)0.993s (~)0.002s (+25.0% 🔺)1.012s (~)0.794s101.58x
🌐 MongoDBNext.js (Turbopack)0.524s0.929s0.001s1.009s0.485s103.78x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.689s (-1.6%)2.686s (-1.1%)0.005s (~)3.325s (-5.4% 🟢)1.636s101.00x
▲ VercelExpress1.716s (-9.3% 🟢)2.758s (+21.0% 🔺)0.010s (+60.9% 🔺)3.369s (+6.1% 🔺)1.653s101.02x
▲ VercelNitro1.774s (+11.2% 🔺)2.720s (+1.0%)0.005s (-96.4% 🟢)3.297s (-3.6%)1.523s101.05x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro12/12
🐘 PostgresNext.js (Turbopack)6/12
▲ VercelExpress6/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres5/12
Next.js (Turbopack)🌐 Redis7/12
Nitro💻 Local5/12
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)

📋 View full workflow run

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Comment threadpackages/ai/src/agent/do-stream-step.ts
- Use space separator in operation.name (not dot) to match AI SDK
- Add resource.name attribute from functionId
- Use recordException() + setStatus() for error spans (preserves stack traces)
- Add context.with() for proper parent-child span propagation
- Make recordSpan self-initializing (remove initTelemetry two-phase requirement)
- Add recordInputs/recordOutputs to TelemetrySettings for sensitive data gating
- Add gen_ai.* semantic convention attributes to doStream span
- Add ai.toolCall.args gated by recordOutputs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Convert contextStorage AsyncLocalStorage from module-scoped to a
globalThis singleton using Symbol.for(). This prevents esbuild's
module scope duplication from creating separate ALS instances, which
caused AsyncLocalStorage.getStore() to return undefined inside tool
execute() callbacks.
Cherry-picked from 8ea3f89 (peter/v2-flow), excluding unrelated
v2-flow runtime changes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread.changeset/durable-agent-improvements.md Outdated
VaguelySeriousand others added 5 commits March 16, 2026 15:52
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Next.js 16.2.0-canary.100+ has a regression where @workflow/ai step
files are missing from the step bundle, causing "doStreamStep not
found" errors that hang the agent tests until timeout.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
DEV_TEST_CONFIG was only set in the dev test job, so prod and postgres
canary jobs didn't skip agent tests. Add NEXT_CANARY env var to all
three local e2e test jobs (dev, prod, postgres) and use it directly.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@karthikscale3karthikscale3 left a comment

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.

Changes look good to me.

  • o11y reporting matches 1:1 to aisdk
  • prepareStep addition looks good

@pranaygppranaygp left a comment

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.

we should really update the e2e tests and the DurableAgent/ToolLoopAgent integration compat tests to prevent regressions here and to validate tat the features actually work

thank you so much!!

VaguelySeriousand others added 5 commits March 16, 2026 17:07
- agentConstructorPrepareStepE2e: verifies agent-level prepareStep is
called for each LLM step through the full workflow runtime
- agentStreamPrepareStepOverrideE2e: verifies stream-level prepareStep
overrides constructor-level
- agentMultimodalToolResultE2e: verifies tools returning
LanguageModelV3ToolResultOutput (type: 'content') pass through the
serialization/deserialization boundary correctly
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add three tests to the ToolLoopAgent compat suite verifying:
- Constructor-level prepareStep is called on each LLM step
- Stream-level prepareStep overrides constructor-level
- Constructor prepareStep fires for every step in multi-step tool loops
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
prepareStep: ({ stepNumber }) => {
stepNumbers.push(stepNumber);
return {};
},

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.

I'm curious if prepareStep is typically used as a step function, or used inline in the workflow context itself?

I did a quick scan on AI sdk docs and looks like your example is exactly what it's typically used for :)

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 action needed - just curious

{ type: 'text', text: 'Here is the image' },
{ type: 'file-data', data: 'iVBORw0KGgo=', mediaType: 'image/png' },
],
};

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.

https://ai-sdk.dev/docs/ai-sdk-core/tools-and-tool-calling#multi-modal-tool-results

nit: should we actually use toModelOutput? looks like that's the intended way to use it since tool authors typically wouldn't write a tool to return in the model message format, but would use the converter

just to make the e2e tests more real? claude, you might want to validate that ToolLoopAgent also propagates this toModelOutput since that example was taken from generateText

@pranaygppranaygp left a comment

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.

lgtm - thanks for adding the tests. left some comments :)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants

@VaguelySerious@pranaygp@karthikscale3
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' DurableAgent: various compatibility fixes by VaguelySerious · Pull Request #1385 · vercel/workflow · GitHub
Skip to content

DurableAgent: various compatibility fixes - #1385

Merged
VaguelySerious merged 18 commits into
mainfrom
peter/combined-durable-agent-fixes
Mar 17, 2026
Merged

DurableAgent: various compatibility fixes#1385
VaguelySerious merged 18 commits into
mainfrom
peter/combined-durable-agent-fixes

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 14, 2026

Copy link
Copy Markdown
Member

Closes#1303 : Support prepareStep on DurableAgent constructor with stream-level override
Closes#1302 : Add InferDurableAgentTools and InferDurableAgentUIMessage type helpers
Closes#1376 : Fix AI_DownloadError for image URLs by defaulting to no-op download
Closes#1296 : Add telemetry span support (ai.streamText.doStream, ai.toolCall) via optional @opentelemetry/api
Closes#848: Allow LanguageModelV3ToolResultOutput results to pass through without json parsin
Closes#975: Documents the necessity of sendStart: false when writing custom UIMessageChunks

Co-Authored-By: @nicoalbanese

… fix, telemetry spans
- Add InferDurableAgentTools and InferDurableAgentUIMessage type helpers (#1302)
- Support prepareStep on DurableAgent constructor with stream-level override (#1303)
- Fix AI_DownloadError for image URLs by defaulting to no-op download (#1376)
- Add telemetry span support (ai.streamText.doStream, ai.toolCall) via optional @opentelemetry/api (#1296)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@VaguelySerious
VaguelySerious requested a review from a team as a code ownerMarch 14, 2026 00:18
@changeset-bot

changeset-botBot commented Mar 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 094fe61

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

This PR includes changesets to release 1 package
NameType
@workflow/aiPatch

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

vercelBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production747067814
✅ 💻 Local Development7700118888
✅ 📦 Local Production7700118888
✅ 🐘 Local Postgres7700118888
✅ 🪟 Windows710374
❌ 🌍 Community Worlds1165515186
✅ 📋 Other195027222
Total3439554663960

❌ Failed Tests

🌍 Community Worlds (55 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

turso (50 failed):

  • addTenWorkflow
  • addTenWorkflow
  • wellKnownAgentWorkflow (.well-known/agent)
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • importedStepOnlyWorkflow
  • hookWorkflow
  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • 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()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • 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
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control)

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6707
✅ example6707
✅ express6707
✅ fastify6707
✅ hono6707
✅ nextjs-turbopack7202
✅ nextjs-webpack7202
✅ nitro6707
✅ nuxt6707
✅ sveltekit6707
✅ vite6707
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7103
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5133
✅ redis-dev302
❌ redis5223
✅ turso-dev302
❌ turso4503
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6509
✅ e2e-local-postgres-nest-stable6509
✅ e2e-local-prod-nest-stable6509

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.039s (-8.7% 🟢)1.006s (~)0.967s101.00x
💻 LocalExpress0.046s (+2.0%)1.005s (-2.0%)0.960s101.18x
💻 LocalNext.js (Turbopack)0.049s1.005s0.956s101.27x
🌐 RedisNext.js (Turbopack)0.054s1.005s0.952s101.39x
🐘 PostgresNext.js (Turbopack)0.061s1.011s0.950s101.57x
🐘 PostgresExpress0.063s (-1.1%)1.012s (~)0.949s101.62x
🐘 PostgresNitro0.067s (+7.7% 🔺)1.017s (+0.5%)0.950s101.74x
🌐 MongoDBNext.js (Turbopack)0.132s1.007s0.876s103.40x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.432s (-54.7% 🟢)2.416s (-18.6% 🟢)1.985s101.00x
▲ VercelExpress0.473s (+1.2%)2.454s (-10.0% 🟢)1.980s101.10x
▲ VercelNitro0.486s (-28.1% 🟢)2.572s (+3.6%)2.085s101.13x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.097s (-2.4%)2.006s (~)0.909s101.00x
💻 LocalNext.js (Turbopack)1.116s2.005s0.889s101.02x
🌐 RedisNext.js (Turbopack)1.132s2.007s0.875s101.03x
💻 LocalExpress1.135s (+1.0%)2.007s (~)0.871s101.04x
🐘 PostgresNext.js (Turbopack)1.146s2.012s0.866s101.05x
🐘 PostgresExpress1.146s (~)2.011s (~)0.865s101.05x
🐘 PostgresNitro1.147s (~)2.013s (~)0.865s101.05x
🌐 MongoDBNext.js (Turbopack)1.306s2.009s0.703s101.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.024s (-5.8% 🟢)3.561s (-6.7% 🟢)1.537s101.00x
▲ VercelExpress2.054s (-1.0%)3.521s (-3.3%)1.467s101.01x
▲ VercelNitro2.169s (-16.8% 🟢)3.862s (-17.8% 🟢)1.693s101.07x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.630s (-2.5%)11.024s (~)0.394s31.00x
💻 LocalNext.js (Turbopack)10.802s11.023s0.221s31.02x
🌐 RedisNext.js (Turbopack)10.812s11.023s0.211s31.02x
🐘 PostgresNext.js (Turbopack)10.836s11.037s0.202s31.02x
💻 LocalExpress10.902s (~)11.024s (~)0.122s31.03x
🐘 PostgresExpress10.932s (~)11.038s (~)0.106s31.03x
🐘 PostgresNitro10.939s (~)11.039s (~)0.100s31.03x
🌐 MongoDBNext.js (Turbopack)12.271s13.022s0.751s31.15x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express16.422s (-3.1%)17.403s (-4.7%)0.981s21.00x
▲ VercelNitro16.722s (-4.4%)18.741s (-7.7% 🟢)2.019s21.02x
▲ VercelNext.js (Turbopack)18.961s (+8.2% 🔺)20.762s (+8.0% 🔺)1.801s21.15x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro26.775s (-2.5%)27.053s (-3.6%)0.278s31.00x
🌐 RedisNext.js (Turbopack)26.787s27.052s0.265s31.00x
🐘 PostgresNext.js (Turbopack)27.016s27.395s0.379s31.01x
🐘 PostgresExpress27.132s (~)27.727s (-1.2%)0.595s31.01x
🐘 PostgresNitro27.235s (~)28.063s (~)0.828s31.02x
💻 LocalNext.js (Turbopack)27.255s28.054s0.799s31.02x
💻 LocalExpress27.513s (~)28.053s (~)0.540s31.03x
🌐 MongoDBNext.js (Turbopack)30.389s31.037s0.649s21.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)45.154s (+2.7%)47.613s (+2.5%)2.459s21.00x
▲ VercelExpress45.218s (+3.1%)46.945s (+2.1%)1.727s21.00x
▲ VercelNitro45.293s (+4.1%)46.791s (+2.7%)1.498s21.00x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)53.414s54.097s0.683s21.00x
🐘 PostgresNext.js (Turbopack)53.876s54.094s0.218s21.01x
🐘 PostgresNitro54.282s (~)55.097s (~)0.815s21.02x
🐘 PostgresExpress54.301s (~)55.100s (~)0.799s21.02x
💻 LocalNitro54.970s (-3.0%)55.107s (-3.5%)0.137s21.03x
💻 LocalNext.js (Turbopack)55.942s56.100s0.158s21.05x
💻 LocalExpress56.868s (~)57.102s (~)0.234s21.06x
🌐 MongoDBNext.js (Turbopack)60.595s61.067s0.472s21.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)93.323s (-3.2%)94.121s (-4.5%)0.798s11.00x
▲ VercelExpress94.753s (+2.1%)97.186s (+3.1%)2.433s11.02x
▲ VercelNitro97.185s (+1.5%)98.493s (+0.6%)1.308s11.04x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.395s2.006s0.612s151.00x
🐘 PostgresNitro1.406s (-2.5%)2.010s (~)0.605s151.01x
🐘 PostgresExpress1.426s (-3.8%)2.010s (~)0.584s151.02x
🐘 PostgresNext.js (Turbopack)1.448s2.011s0.563s151.04x
💻 LocalNitro1.503s (+0.8%)2.005s (~)0.502s151.08x
💻 LocalNext.js (Turbopack)1.539s2.005s0.466s151.10x
💻 LocalExpress1.564s (+5.7% 🔺)2.006s (~)0.442s151.12x
🌐 MongoDBNext.js (Turbopack)2.159s3.008s0.850s101.55x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.150s (-6.1% 🟢)3.703s (-5.5% 🟢)1.553s91.00x
▲ VercelNext.js (Turbopack)2.251s (-10.5% 🟢)4.018s (-1.9%)1.768s81.05x
▲ VercelNitro2.305s (-14.9% 🟢)3.938s (-10.2% 🟢)1.633s81.07x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.566s (-1.4%)3.013s (~)0.447s101.00x
🌐 RedisNext.js (Turbopack)2.582s3.009s0.427s101.01x
🐘 PostgresNitro2.595s (~)3.012s (~)0.417s101.01x
💻 LocalNitro2.637s (-7.7% 🟢)3.007s (-10.0% 🟢)0.370s101.03x
💻 LocalNext.js (Turbopack)2.751s3.107s0.356s101.07x
🐘 PostgresNext.js (Turbopack)2.759s3.213s0.454s101.08x
💻 LocalExpress2.978s (+0.7%)3.564s (+7.7% 🔺)0.586s91.16x
🌐 MongoDBNext.js (Turbopack)4.670s5.177s0.507s61.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.567s (-4.4%)4.252s (+2.1%)1.685s81.00x
▲ VercelExpress2.843s (+12.8% 🔺)3.944s (-10.1% 🟢)1.100s81.11x
▲ VercelNext.js (Turbopack)2.890s (+8.4% 🔺)4.524s (-2.4%)1.635s71.13x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.916s (-1.8%)4.444s (-6.1% 🟢)0.528s71.00x
🐘 PostgresExpress4.020s (+0.7%)4.446s (~)0.426s71.03x
🌐 RedisNext.js (Turbopack)4.133s5.013s0.880s61.06x
🐘 PostgresNext.js (Turbopack)4.540s5.017s0.477s61.16x
💻 LocalNitro7.038s (-13.8% 🟢)7.416s (-17.8% 🟢)0.378s51.80x
💻 LocalNext.js (Turbopack)7.244s7.516s0.273s41.85x
💻 LocalExpress8.511s (+4.4%)9.022s (+2.9%)0.510s42.17x
🌐 MongoDBNext.js (Turbopack)9.758s10.348s0.590s32.49x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.898s (-15.7% 🟢)4.312s (-16.1% 🟢)1.413s71.00x
▲ VercelNitro3.676s (+20.1% 🔺)5.290s (+15.7% 🔺)1.614s61.27x
▲ VercelNext.js (Turbopack)3.739s (-1.7%)5.321s (-3.6%)1.583s61.29x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.330s2.007s0.676s151.00x
🐘 PostgresNitro1.407s (-1.0%)2.010s (~)0.603s151.06x
🐘 PostgresNext.js (Turbopack)1.437s2.011s0.574s151.08x
💻 LocalNitro1.477s (-3.6%)2.005s (~)0.528s151.11x
🐘 PostgresExpress1.496s (+8.1% 🔺)2.077s (+3.3%)0.581s151.12x
💻 LocalNext.js (Turbopack)1.531s2.005s0.475s151.15x
💻 LocalExpress1.539s (+0.5%)2.005s (~)0.466s151.16x
🌐 MongoDBNext.js (Turbopack)2.196s3.009s0.813s101.65x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.185s (-16.2% 🟢)3.438s (-22.8% 🟢)1.253s91.00x
▲ VercelNext.js (Turbopack)2.375s (+6.5% 🔺)3.752s (~)1.376s81.09x
▲ VercelNitro2.386s (+1.1%)4.575s (+0.6%)2.189s71.09x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.484s (-6.7% 🟢)3.010s (-3.3%)0.526s101.00x
🌐 RedisNext.js (Turbopack)2.560s3.008s0.448s101.03x
🐘 PostgresNext.js (Turbopack)2.564s3.012s0.448s101.03x
🐘 PostgresExpress2.609s (+3.7%)3.012s (~)0.403s101.05x
💻 LocalNitro2.707s (-11.3% 🟢)3.009s (-22.6% 🟢)0.302s101.09x
💻 LocalExpress3.041s (+1.7%)3.886s (+9.0% 🔺)0.845s81.22x
💻 LocalNext.js (Turbopack)3.070s3.759s0.689s81.24x
🌐 MongoDBNext.js (Turbopack)4.662s5.177s0.516s61.88x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.259s (-18.2% 🟢)3.694s (-9.9% 🟢)1.435s91.00x
▲ VercelNitro2.624s (+9.4% 🔺)4.394s (+8.4% 🔺)1.770s71.16x
▲ VercelNext.js (Turbopack)2.669s (+6.8% 🔺)4.250s (+6.8% 🔺)1.582s81.18x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.911s (-1.1%)4.590s (~)0.679s71.00x
🐘 PostgresNitro3.950s (-3.3%)4.588s (+3.2%)0.638s71.01x
🌐 RedisNext.js (Turbopack)4.255s5.011s0.756s61.09x
🐘 PostgresNext.js (Turbopack)4.556s5.021s0.466s61.16x
💻 LocalNitro7.397s (-20.4% 🟢)8.019s (-20.0% 🟢)0.622s41.89x
💻 LocalNext.js (Turbopack)8.347s8.767s0.420s42.13x
💻 LocalExpress8.882s (+1.7%)9.270s (+2.8%)0.388s42.27x
🌐 MongoDBNext.js (Turbopack)9.824s10.347s0.523s32.51x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.719s (-1.6%)4.485s (+10.9% 🔺)1.767s71.00x
▲ VercelNitro3.158s (+18.9% 🔺)4.745s (+21.7% 🔺)1.587s71.16x
▲ VercelNext.js (Turbopack)3.199s (-10.0% 🟢)5.271s (-3.5%)2.073s61.18x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.138s (-30.2% 🟢)1.003s (~)0.009s (-18.8% 🟢)1.016s (~)0.877s101.00x
🌐 RedisNext.js (Turbopack)0.175s1.000s0.001s1.008s0.833s101.26x
💻 LocalNext.js (Turbopack)0.178s1.001s0.011s1.017s0.839s101.29x
🐘 PostgresNext.js (Turbopack)0.198s1.002s0.001s1.013s0.815s101.43x
💻 LocalExpress0.207s (+6.1% 🔺)1.003s (~)0.012s (+7.0% 🔺)1.019s (~)0.812s101.49x
🐘 PostgresNitro0.213s (-3.7%)0.997s (~)0.002s (+15.4% 🔺)1.012s (~)0.799s101.54x
🐘 PostgresExpress0.218s (-1.6%)0.993s (~)0.002s (+25.0% 🔺)1.012s (~)0.794s101.58x
🌐 MongoDBNext.js (Turbopack)0.524s0.929s0.001s1.009s0.485s103.78x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.689s (-1.6%)2.686s (-1.1%)0.005s (~)3.325s (-5.4% 🟢)1.636s101.00x
▲ VercelExpress1.716s (-9.3% 🟢)2.758s (+21.0% 🔺)0.010s (+60.9% 🔺)3.369s (+6.1% 🔺)1.653s101.02x
▲ VercelNitro1.774s (+11.2% 🔺)2.720s (+1.0%)0.005s (-96.4% 🟢)3.297s (-3.6%)1.523s101.05x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro12/12
🐘 PostgresNext.js (Turbopack)6/12
▲ VercelExpress6/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres5/12
Next.js (Turbopack)🌐 Redis7/12
Nitro💻 Local5/12
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)

📋 View full workflow run

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Comment threadpackages/ai/src/agent/do-stream-step.ts
- Use space separator in operation.name (not dot) to match AI SDK
- Add resource.name attribute from functionId
- Use recordException() + setStatus() for error spans (preserves stack traces)
- Add context.with() for proper parent-child span propagation
- Make recordSpan self-initializing (remove initTelemetry two-phase requirement)
- Add recordInputs/recordOutputs to TelemetrySettings for sensitive data gating
- Add gen_ai.* semantic convention attributes to doStream span
- Add ai.toolCall.args gated by recordOutputs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Convert contextStorage AsyncLocalStorage from module-scoped to a
globalThis singleton using Symbol.for(). This prevents esbuild's
module scope duplication from creating separate ALS instances, which
caused AsyncLocalStorage.getStore() to return undefined inside tool
execute() callbacks.
Cherry-picked from 8ea3f89 (peter/v2-flow), excluding unrelated
v2-flow runtime changes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread.changeset/durable-agent-improvements.md Outdated
VaguelySeriousand others added 5 commits March 16, 2026 15:52
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Next.js 16.2.0-canary.100+ has a regression where @workflow/ai step
files are missing from the step bundle, causing "doStreamStep not
found" errors that hang the agent tests until timeout.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
DEV_TEST_CONFIG was only set in the dev test job, so prod and postgres
canary jobs didn't skip agent tests. Add NEXT_CANARY env var to all
three local e2e test jobs (dev, prod, postgres) and use it directly.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@karthikscale3karthikscale3 left a comment

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.

Changes look good to me.

  • o11y reporting matches 1:1 to aisdk
  • prepareStep addition looks good

@pranaygppranaygp left a comment

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.

we should really update the e2e tests and the DurableAgent/ToolLoopAgent integration compat tests to prevent regressions here and to validate tat the features actually work

thank you so much!!

VaguelySeriousand others added 5 commits March 16, 2026 17:07
- agentConstructorPrepareStepE2e: verifies agent-level prepareStep is
called for each LLM step through the full workflow runtime
- agentStreamPrepareStepOverrideE2e: verifies stream-level prepareStep
overrides constructor-level
- agentMultimodalToolResultE2e: verifies tools returning
LanguageModelV3ToolResultOutput (type: 'content') pass through the
serialization/deserialization boundary correctly
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add three tests to the ToolLoopAgent compat suite verifying:
- Constructor-level prepareStep is called on each LLM step
- Stream-level prepareStep overrides constructor-level
- Constructor prepareStep fires for every step in multi-step tool loops
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
prepareStep: ({ stepNumber }) => {
stepNumbers.push(stepNumber);
return {};
},

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.

I'm curious if prepareStep is typically used as a step function, or used inline in the workflow context itself?

I did a quick scan on AI sdk docs and looks like your example is exactly what it's typically used for :)

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 action needed - just curious

{ type: 'text', text: 'Here is the image' },
{ type: 'file-data', data: 'iVBORw0KGgo=', mediaType: 'image/png' },
],
};

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.

https://ai-sdk.dev/docs/ai-sdk-core/tools-and-tool-calling#multi-modal-tool-results

nit: should we actually use toModelOutput? looks like that's the intended way to use it since tool authors typically wouldn't write a tool to return in the model message format, but would use the converter

just to make the e2e tests more real? claude, you might want to validate that ToolLoopAgent also propagates this toModelOutput since that example was taken from generateText

@pranaygppranaygp left a comment

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.

lgtm - thanks for adding the tests. left some comments :)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants

@VaguelySerious@pranaygp@karthikscale3
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); DurableAgent: various compatibility fixes by VaguelySerious · Pull Request #1385 · vercel/workflow · GitHub
Skip to content

DurableAgent: various compatibility fixes - #1385

Merged
VaguelySerious merged 18 commits into
mainfrom
peter/combined-durable-agent-fixes
Mar 17, 2026
Merged

DurableAgent: various compatibility fixes#1385
VaguelySerious merged 18 commits into
mainfrom
peter/combined-durable-agent-fixes

Conversation

@VaguelySerious

@VaguelySeriousVaguelySerious commented Mar 14, 2026

Copy link
Copy Markdown
Member

Closes#1303 : Support prepareStep on DurableAgent constructor with stream-level override
Closes#1302 : Add InferDurableAgentTools and InferDurableAgentUIMessage type helpers
Closes#1376 : Fix AI_DownloadError for image URLs by defaulting to no-op download
Closes#1296 : Add telemetry span support (ai.streamText.doStream, ai.toolCall) via optional @opentelemetry/api
Closes#848: Allow LanguageModelV3ToolResultOutput results to pass through without json parsin
Closes#975: Documents the necessity of sendStart: false when writing custom UIMessageChunks

Co-Authored-By: @nicoalbanese

… fix, telemetry spans
- Add InferDurableAgentTools and InferDurableAgentUIMessage type helpers (#1302)
- Support prepareStep on DurableAgent constructor with stream-level override (#1303)
- Fix AI_DownloadError for image URLs by defaulting to no-op download (#1376)
- Add telemetry span support (ai.streamText.doStream, ai.toolCall) via optional @opentelemetry/api (#1296)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@VaguelySerious
VaguelySerious requested a review from a team as a code ownerMarch 14, 2026 00:18
@changeset-bot

changeset-botBot commented Mar 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 094fe61

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

This PR includes changesets to release 1 package
NameType
@workflow/aiPatch

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

vercelBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production747067814
✅ 💻 Local Development7700118888
✅ 📦 Local Production7700118888
✅ 🐘 Local Postgres7700118888
✅ 🪟 Windows710374
❌ 🌍 Community Worlds1165515186
✅ 📋 Other195027222
Total3439554663960

❌ Failed Tests

🌍 Community Worlds (55 failed)

mongodb (3 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

redis (2 failed):

  • hookWorkflow is not resumable via public webhook endpoint
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously

turso (50 failed):

  • addTenWorkflow
  • addTenWorkflow
  • wellKnownAgentWorkflow (.well-known/agent)
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • importedStepOnlyWorkflow
  • hookWorkflow
  • hookWorkflow is not resumable via public webhook endpoint
  • webhookWorkflow
  • sleepingWorkflow
  • parallelSleepWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • 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()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • closureVariableWorkflow - nested step functions with closure variables
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE
  • instanceMethodStepWorkflow - instance methods with "use step" directive
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument
  • cancelRun - cancelling a running workflow
  • cancelRun via CLI - cancelling a running workflow
  • 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
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control)

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro6707
✅ example6707
✅ express6707
✅ fastify6707
✅ hono6707
✅ nextjs-turbopack7202
✅ nextjs-webpack7202
✅ nitro6707
✅ nuxt6707
✅ sveltekit6707
✅ vite6707
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable6509
✅ express-stable6509
✅ fastify-stable6509
✅ hono-stable6509
✅ nextjs-turbopack-canary54020
✅ nextjs-turbopack-stable7103
✅ nextjs-webpack-canary54020
✅ nextjs-webpack-stable7103
✅ nitro-stable6509
✅ nuxt-stable6509
✅ sveltekit-stable6509
✅ vite-stable6509
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack7103
❌ 🌍 Community Worlds
AppPassedFailedSkipped
✅ mongodb-dev302
❌ mongodb5133
✅ redis-dev302
❌ redis5223
✅ turso-dev302
❌ turso4503
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable6509
✅ e2e-local-postgres-nest-stable6509
✅ e2e-local-prod-nest-stable6509

📋 View full workflow run

@github-actions

github-actionsBot commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.039s (-8.7% 🟢)1.006s (~)0.967s101.00x
💻 LocalExpress0.046s (+2.0%)1.005s (-2.0%)0.960s101.18x
💻 LocalNext.js (Turbopack)0.049s1.005s0.956s101.27x
🌐 RedisNext.js (Turbopack)0.054s1.005s0.952s101.39x
🐘 PostgresNext.js (Turbopack)0.061s1.011s0.950s101.57x
🐘 PostgresExpress0.063s (-1.1%)1.012s (~)0.949s101.62x
🐘 PostgresNitro0.067s (+7.7% 🔺)1.017s (+0.5%)0.950s101.74x
🌐 MongoDBNext.js (Turbopack)0.132s1.007s0.876s103.40x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)0.432s (-54.7% 🟢)2.416s (-18.6% 🟢)1.985s101.00x
▲ VercelExpress0.473s (+1.2%)2.454s (-10.0% 🟢)1.980s101.10x
▲ VercelNitro0.486s (-28.1% 🟢)2.572s (+3.6%)2.085s101.13x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.097s (-2.4%)2.006s (~)0.909s101.00x
💻 LocalNext.js (Turbopack)1.116s2.005s0.889s101.02x
🌐 RedisNext.js (Turbopack)1.132s2.007s0.875s101.03x
💻 LocalExpress1.135s (+1.0%)2.007s (~)0.871s101.04x
🐘 PostgresNext.js (Turbopack)1.146s2.012s0.866s101.05x
🐘 PostgresExpress1.146s (~)2.011s (~)0.865s101.05x
🐘 PostgresNitro1.147s (~)2.013s (~)0.865s101.05x
🌐 MongoDBNext.js (Turbopack)1.306s2.009s0.703s101.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.024s (-5.8% 🟢)3.561s (-6.7% 🟢)1.537s101.00x
▲ VercelExpress2.054s (-1.0%)3.521s (-3.3%)1.467s101.01x
▲ VercelNitro2.169s (-16.8% 🟢)3.862s (-17.8% 🟢)1.693s101.07x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.630s (-2.5%)11.024s (~)0.394s31.00x
💻 LocalNext.js (Turbopack)10.802s11.023s0.221s31.02x
🌐 RedisNext.js (Turbopack)10.812s11.023s0.211s31.02x
🐘 PostgresNext.js (Turbopack)10.836s11.037s0.202s31.02x
💻 LocalExpress10.902s (~)11.024s (~)0.122s31.03x
🐘 PostgresExpress10.932s (~)11.038s (~)0.106s31.03x
🐘 PostgresNitro10.939s (~)11.039s (~)0.100s31.03x
🌐 MongoDBNext.js (Turbopack)12.271s13.022s0.751s31.15x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express16.422s (-3.1%)17.403s (-4.7%)0.981s21.00x
▲ VercelNitro16.722s (-4.4%)18.741s (-7.7% 🟢)2.019s21.02x
▲ VercelNext.js (Turbopack)18.961s (+8.2% 🔺)20.762s (+8.0% 🔺)1.801s21.15x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro26.775s (-2.5%)27.053s (-3.6%)0.278s31.00x
🌐 RedisNext.js (Turbopack)26.787s27.052s0.265s31.00x
🐘 PostgresNext.js (Turbopack)27.016s27.395s0.379s31.01x
🐘 PostgresExpress27.132s (~)27.727s (-1.2%)0.595s31.01x
🐘 PostgresNitro27.235s (~)28.063s (~)0.828s31.02x
💻 LocalNext.js (Turbopack)27.255s28.054s0.799s31.02x
💻 LocalExpress27.513s (~)28.053s (~)0.540s31.03x
🌐 MongoDBNext.js (Turbopack)30.389s31.037s0.649s21.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)45.154s (+2.7%)47.613s (+2.5%)2.459s21.00x
▲ VercelExpress45.218s (+3.1%)46.945s (+2.1%)1.727s21.00x
▲ VercelNitro45.293s (+4.1%)46.791s (+2.7%)1.498s21.00x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)53.414s54.097s0.683s21.00x
🐘 PostgresNext.js (Turbopack)53.876s54.094s0.218s21.01x
🐘 PostgresNitro54.282s (~)55.097s (~)0.815s21.02x
🐘 PostgresExpress54.301s (~)55.100s (~)0.799s21.02x
💻 LocalNitro54.970s (-3.0%)55.107s (-3.5%)0.137s21.03x
💻 LocalNext.js (Turbopack)55.942s56.100s0.158s21.05x
💻 LocalExpress56.868s (~)57.102s (~)0.234s21.06x
🌐 MongoDBNext.js (Turbopack)60.595s61.067s0.472s21.13x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)93.323s (-3.2%)94.121s (-4.5%)0.798s11.00x
▲ VercelExpress94.753s (+2.1%)97.186s (+3.1%)2.433s11.02x
▲ VercelNitro97.185s (+1.5%)98.493s (+0.6%)1.308s11.04x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.395s2.006s0.612s151.00x
🐘 PostgresNitro1.406s (-2.5%)2.010s (~)0.605s151.01x
🐘 PostgresExpress1.426s (-3.8%)2.010s (~)0.584s151.02x
🐘 PostgresNext.js (Turbopack)1.448s2.011s0.563s151.04x
💻 LocalNitro1.503s (+0.8%)2.005s (~)0.502s151.08x
💻 LocalNext.js (Turbopack)1.539s2.005s0.466s151.10x
💻 LocalExpress1.564s (+5.7% 🔺)2.006s (~)0.442s151.12x
🌐 MongoDBNext.js (Turbopack)2.159s3.008s0.850s101.55x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.150s (-6.1% 🟢)3.703s (-5.5% 🟢)1.553s91.00x
▲ VercelNext.js (Turbopack)2.251s (-10.5% 🟢)4.018s (-1.9%)1.768s81.05x
▲ VercelNitro2.305s (-14.9% 🟢)3.938s (-10.2% 🟢)1.633s81.07x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.566s (-1.4%)3.013s (~)0.447s101.00x
🌐 RedisNext.js (Turbopack)2.582s3.009s0.427s101.01x
🐘 PostgresNitro2.595s (~)3.012s (~)0.417s101.01x
💻 LocalNitro2.637s (-7.7% 🟢)3.007s (-10.0% 🟢)0.370s101.03x
💻 LocalNext.js (Turbopack)2.751s3.107s0.356s101.07x
🐘 PostgresNext.js (Turbopack)2.759s3.213s0.454s101.08x
💻 LocalExpress2.978s (+0.7%)3.564s (+7.7% 🔺)0.586s91.16x
🌐 MongoDBNext.js (Turbopack)4.670s5.177s0.507s61.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.567s (-4.4%)4.252s (+2.1%)1.685s81.00x
▲ VercelExpress2.843s (+12.8% 🔺)3.944s (-10.1% 🟢)1.100s81.11x
▲ VercelNext.js (Turbopack)2.890s (+8.4% 🔺)4.524s (-2.4%)1.635s71.13x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro3.916s (-1.8%)4.444s (-6.1% 🟢)0.528s71.00x
🐘 PostgresExpress4.020s (+0.7%)4.446s (~)0.426s71.03x
🌐 RedisNext.js (Turbopack)4.133s5.013s0.880s61.06x
🐘 PostgresNext.js (Turbopack)4.540s5.017s0.477s61.16x
💻 LocalNitro7.038s (-13.8% 🟢)7.416s (-17.8% 🟢)0.378s51.80x
💻 LocalNext.js (Turbopack)7.244s7.516s0.273s41.85x
💻 LocalExpress8.511s (+4.4%)9.022s (+2.9%)0.510s42.17x
🌐 MongoDBNext.js (Turbopack)9.758s10.348s0.590s32.49x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.898s (-15.7% 🟢)4.312s (-16.1% 🟢)1.413s71.00x
▲ VercelNitro3.676s (+20.1% 🔺)5.290s (+15.7% 🔺)1.614s61.27x
▲ VercelNext.js (Turbopack)3.739s (-1.7%)5.321s (-3.6%)1.583s61.29x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Redis🥇 Next.js (Turbopack)1.330s2.007s0.676s151.00x
🐘 PostgresNitro1.407s (-1.0%)2.010s (~)0.603s151.06x
🐘 PostgresNext.js (Turbopack)1.437s2.011s0.574s151.08x
💻 LocalNitro1.477s (-3.6%)2.005s (~)0.528s151.11x
🐘 PostgresExpress1.496s (+8.1% 🔺)2.077s (+3.3%)0.581s151.12x
💻 LocalNext.js (Turbopack)1.531s2.005s0.475s151.15x
💻 LocalExpress1.539s (+0.5%)2.005s (~)0.466s151.16x
🌐 MongoDBNext.js (Turbopack)2.196s3.009s0.813s101.65x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.185s (-16.2% 🟢)3.438s (-22.8% 🟢)1.253s91.00x
▲ VercelNext.js (Turbopack)2.375s (+6.5% 🔺)3.752s (~)1.376s81.09x
▲ VercelNitro2.386s (+1.1%)4.575s (+0.6%)2.189s71.09x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro2.484s (-6.7% 🟢)3.010s (-3.3%)0.526s101.00x
🌐 RedisNext.js (Turbopack)2.560s3.008s0.448s101.03x
🐘 PostgresNext.js (Turbopack)2.564s3.012s0.448s101.03x
🐘 PostgresExpress2.609s (+3.7%)3.012s (~)0.403s101.05x
💻 LocalNitro2.707s (-11.3% 🟢)3.009s (-22.6% 🟢)0.302s101.09x
💻 LocalExpress3.041s (+1.7%)3.886s (+9.0% 🔺)0.845s81.22x
💻 LocalNext.js (Turbopack)3.070s3.759s0.689s81.24x
🌐 MongoDBNext.js (Turbopack)4.662s5.177s0.516s61.88x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.259s (-18.2% 🟢)3.694s (-9.9% 🟢)1.435s91.00x
▲ VercelNitro2.624s (+9.4% 🔺)4.394s (+8.4% 🔺)1.770s71.16x
▲ VercelNext.js (Turbopack)2.669s (+6.8% 🔺)4.250s (+6.8% 🔺)1.582s81.18x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.911s (-1.1%)4.590s (~)0.679s71.00x
🐘 PostgresNitro3.950s (-3.3%)4.588s (+3.2%)0.638s71.01x
🌐 RedisNext.js (Turbopack)4.255s5.011s0.756s61.09x
🐘 PostgresNext.js (Turbopack)4.556s5.021s0.466s61.16x
💻 LocalNitro7.397s (-20.4% 🟢)8.019s (-20.0% 🟢)0.622s41.89x
💻 LocalNext.js (Turbopack)8.347s8.767s0.420s42.13x
💻 LocalExpress8.882s (+1.7%)9.270s (+2.8%)0.388s42.27x
🌐 MongoDBNext.js (Turbopack)9.824s10.347s0.523s32.51x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.719s (-1.6%)4.485s (+10.9% 🔺)1.767s71.00x
▲ VercelNitro3.158s (+18.9% 🔺)4.745s (+21.7% 🔺)1.587s71.16x
▲ VercelNext.js (Turbopack)3.199s (-10.0% 🟢)5.271s (-3.5%)2.073s61.18x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.138s (-30.2% 🟢)1.003s (~)0.009s (-18.8% 🟢)1.016s (~)0.877s101.00x
🌐 RedisNext.js (Turbopack)0.175s1.000s0.001s1.008s0.833s101.26x
💻 LocalNext.js (Turbopack)0.178s1.001s0.011s1.017s0.839s101.29x
🐘 PostgresNext.js (Turbopack)0.198s1.002s0.001s1.013s0.815s101.43x
💻 LocalExpress0.207s (+6.1% 🔺)1.003s (~)0.012s (+7.0% 🔺)1.019s (~)0.812s101.49x
🐘 PostgresNitro0.213s (-3.7%)0.997s (~)0.002s (+15.4% 🔺)1.012s (~)0.799s101.54x
🐘 PostgresExpress0.218s (-1.6%)0.993s (~)0.002s (+25.0% 🔺)1.012s (~)0.794s101.58x
🌐 MongoDBNext.js (Turbopack)0.524s0.929s0.001s1.009s0.485s103.78x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.689s (-1.6%)2.686s (-1.1%)0.005s (~)3.325s (-5.4% 🟢)1.636s101.00x
▲ VercelExpress1.716s (-9.3% 🟢)2.758s (+21.0% 🔺)0.010s (+60.9% 🔺)3.369s (+6.1% 🔺)1.653s101.02x
▲ VercelNitro1.774s (+11.2% 🔺)2.720s (+1.0%)0.005s (-96.4% 🟢)3.297s (-3.6%)1.523s101.05x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro12/12
🐘 PostgresNext.js (Turbopack)6/12
▲ VercelExpress6/12
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres5/12
Next.js (Turbopack)🌐 Redis7/12
Nitro💻 Local5/12
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)

📋 View full workflow run

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Comment threadpackages/ai/src/agent/do-stream-step.ts
- Use space separator in operation.name (not dot) to match AI SDK
- Add resource.name attribute from functionId
- Use recordException() + setStatus() for error spans (preserves stack traces)
- Add context.with() for proper parent-child span propagation
- Make recordSpan self-initializing (remove initTelemetry two-phase requirement)
- Add recordInputs/recordOutputs to TelemetrySettings for sensitive data gating
- Add gen_ai.* semantic convention attributes to doStream span
- Add ai.toolCall.args gated by recordOutputs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Convert contextStorage AsyncLocalStorage from module-scoped to a
globalThis singleton using Symbol.for(). This prevents esbuild's
module scope duplication from creating separate ALS instances, which
caused AsyncLocalStorage.getStore() to return undefined inside tool
execute() callbacks.
Cherry-picked from 8ea3f89 (peter/v2-flow), excluding unrelated
v2-flow runtime changes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread.changeset/durable-agent-improvements.md Outdated
VaguelySeriousand others added 5 commits March 16, 2026 15:52
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Next.js 16.2.0-canary.100+ has a regression where @workflow/ai step
files are missing from the step bundle, causing "doStreamStep not
found" errors that hang the agent tests until timeout.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
DEV_TEST_CONFIG was only set in the dev test job, so prod and postgres
canary jobs didn't skip agent tests. Add NEXT_CANARY env var to all
three local e2e test jobs (dev, prod, postgres) and use it directly.
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@karthikscale3karthikscale3 left a comment

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.

Changes look good to me.

  • o11y reporting matches 1:1 to aisdk
  • prepareStep addition looks good

@pranaygppranaygp left a comment

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.

we should really update the e2e tests and the DurableAgent/ToolLoopAgent integration compat tests to prevent regressions here and to validate tat the features actually work

thank you so much!!

VaguelySeriousand others added 5 commits March 16, 2026 17:07
- agentConstructorPrepareStepE2e: verifies agent-level prepareStep is
called for each LLM step through the full workflow runtime
- agentStreamPrepareStepOverrideE2e: verifies stream-level prepareStep
overrides constructor-level
- agentMultimodalToolResultE2e: verifies tools returning
LanguageModelV3ToolResultOutput (type: 'content') pass through the
serialization/deserialization boundary correctly
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add three tests to the ToolLoopAgent compat suite verifying:
- Constructor-level prepareStep is called on each LLM step
- Stream-level prepareStep overrides constructor-level
- Constructor prepareStep fires for every step in multi-step tool loops
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
prepareStep: ({ stepNumber }) => {
stepNumbers.push(stepNumber);
return {};
},

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.

I'm curious if prepareStep is typically used as a step function, or used inline in the workflow context itself?

I did a quick scan on AI sdk docs and looks like your example is exactly what it's typically used for :)

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 action needed - just curious

{ type: 'text', text: 'Here is the image' },
{ type: 'file-data', data: 'iVBORw0KGgo=', mediaType: 'image/png' },
],
};

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.

https://ai-sdk.dev/docs/ai-sdk-core/tools-and-tool-calling#multi-modal-tool-results

nit: should we actually use toModelOutput? looks like that's the intended way to use it since tool authors typically wouldn't write a tool to return in the model message format, but would use the converter

just to make the e2e tests more real? claude, you might want to validate that ToolLoopAgent also propagates this toModelOutput since that example was taken from generateText

@pranaygppranaygp left a comment

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.

lgtm - thanks for adding the tests. left some comments :)

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants

@VaguelySerious@pranaygp@karthikscale3