Fix: Handle object-style finishReason for AI SDK v5/v6 compatibility - #695

Merged
VaguelySerious merged 10 commits into
mainfrom
ctate/fix-durable-agent-finish-reason
Dec 28, 2025
Merged

Fix: Handle object-style finishReason for AI SDK v5/v6 compatibility#695
VaguelySerious merged 10 commits into
mainfrom
ctate/fix-durable-agent-finish-reason

Conversation

@ctate

Copy link
Copy Markdown
Contributor

Users were encountering the following error when using DurableAgent with AI SDK v6:

Error: Unexpected finish reason: [object Object]
at streamTextIterator (stream-text-iterator.ts:327:12)

This occurred because AI SDK v6 (or certain providers) may return finishReason as an object with a type property (e.g., { type: 'stop' }) rather than a plain string like 'stop' as in AI SDK v5.

Solution

  • Added normalization logic in stream-text-iterator.ts and do-stream-step.ts to handle both formats
  • Uses the AI SDK's FinishReason type directly from the ai package, ensuring 1:1 type compatibility with whichever version the consuming app uses (v5 or v6)
  • Improved error messaging to show the actual object value via JSON.stringify when an unexpected finish reason is encountered

@vercel

vercelBot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Dec 28, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 270e3ef

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

@github-actions

github-actionsBot commented Dec 28, 2025

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
🌐 Starter🥇 Next.js (Turbopack)0.039s (+7.2% 🔺)1.014s (~)0.975s101.00x
🌐 RedisNext.js (Turbopack)0.040s (-0.7%)1.017s (~)0.977s101.04x
💻 LocalNitro0.043s (~)1.006s (~)0.963s101.12x
💻 LocalExpress0.043s (~)1.007s (~)0.964s101.12x
💻 LocalNext.js (Turbopack)0.044s (+16.2% 🔺)1.019s (~)0.975s101.13x
🌐 TursoNext.js (Turbopack)0.098s (+22.3% 🔺)1.015s (~)0.917s102.54x
🌐 MongoDBNext.js (Turbopack)0.120s (+133.0% 🔺)1.016s (~)0.896s103.11x
🐘 PostgresNitro0.198s (-33.6% 🟢)1.024s (+1.2%)0.826s105.14x
🐘 PostgresExpress0.363s (+23.8% 🔺)1.014s (-0.5%)0.651s109.40x
🐘 PostgresNext.js (Turbopack)0.372s (+4.8%)1.022s (~)0.650s109.64x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.584s (-0.6%)1.530s (+2.8%)0.947s101.00x
▲ VercelNext.js (Turbopack)0.614s (+14.9% 🔺)1.605s (-0.6%)0.991s101.05x
▲ VercelExpress0.632s (+28.0% 🔺)1.753s (+27.6% 🔺)1.122s101.08x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.092s (+1.1%)2.009s (~)0.918s101.00x
💻 LocalNext.js (Turbopack)1.100s (+0.6%)2.011s (~)0.911s101.01x
🌐 RedisNext.js (Turbopack)1.101s (~)2.013s (~)0.912s101.01x
💻 LocalExpress1.112s (~)2.007s (~)0.895s101.02x
💻 LocalNitro1.114s (~)2.006s (~)0.892s101.02x
🌐 MongoDBNext.js (Turbopack)1.278s (-1.2%)2.015s (~)0.736s101.17x
🌐 TursoNext.js (Turbopack)1.284s (~)2.012s (~)0.728s101.18x
🐘 PostgresNext.js (Turbopack)1.598s (-31.5% 🟢)2.015s (-33.2% 🟢)0.417s101.46x
🐘 PostgresExpress2.211s (+2.5%)3.015s (~)0.804s102.03x
🐘 PostgresNitro2.365s (+9.7% 🔺)3.013s (~)0.648s102.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.648s (-1.0%)3.697s (~)1.049s101.00x
▲ VercelExpress2.745s (+1.6%)3.734s (+3.7%)0.989s101.04x
▲ VercelNitro2.779s (+11.6% 🔺)3.625s (~)0.846s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.612s (~)11.011s (~)0.399s51.00x
🌐 RedisNext.js (Turbopack)10.693s (~)11.021s (~)0.328s51.01x
💻 LocalNext.js (Turbopack)10.698s (+0.6%)11.022s (~)0.324s51.01x
💻 LocalExpress10.781s (~)11.011s (~)0.231s51.02x
💻 LocalNitro10.793s (~)11.012s (~)0.219s51.02x
🌐 MongoDBNext.js (Turbopack)12.126s (-0.5%)12.630s (-3.0%)0.505s51.14x
🌐 TursoNext.js (Turbopack)12.189s (~)13.023s (~)0.834s51.15x
🐘 PostgresNext.js (Turbopack)14.249s (-18.9% 🟢)15.040s (-17.5% 🟢)0.790s51.34x
🐘 PostgresExpress20.337s (-0.6%)21.036s (~)0.699s51.92x
🐘 PostgresNitro20.372s (-0.5%)21.037s (~)0.664s51.92x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.491s (+1.1%)22.413s (+2.0%)0.921s51.00x
▲ VercelNitro21.547s (+1.5%)22.424s (+1.9%)0.877s51.00x
▲ VercelNext.js (Turbopack)21.792s (+1.2%)22.753s (+1.1%)0.961s51.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.350s (+0.9%)2.007s (~)0.657s151.00x
🌐 RedisNext.js (Turbopack)1.371s (~)2.011s (~)0.640s151.02x
💻 LocalNext.js (Turbopack)1.398s (~)2.012s (~)0.614s151.04x
💻 LocalExpress1.399s (-1.0%)2.005s (~)0.606s151.04x
💻 LocalNitro1.412s (~)2.006s (~)0.594s151.05x
🐘 PostgresNext.js (Turbopack)1.820s (-7.2% 🟢)2.015s (-3.1%)0.194s151.35x
🌐 MongoDBNext.js (Turbopack)2.131s (-1.4%)3.017s (~)0.887s101.58x
🌐 TursoNext.js (Turbopack)2.227s (+5.0%)3.013s (~)0.786s101.65x
🐘 PostgresExpress2.380s (~)3.014s (~)0.633s101.76x
🐘 PostgresNitro2.582s (+8.7% 🔺)3.015s (~)0.433s101.91x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.782s (+3.5%)3.715s (+3.1%)0.933s91.00x
▲ VercelNitro3.002s (+6.5% 🔺)3.732s (-2.9%)0.730s91.08x
▲ VercelNext.js (Turbopack)3.399s (+15.5% 🔺)4.296s (+9.7% 🔺)0.897s81.22x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.146s (+4.6%)3.030s (+4.3%)0.884s101.00x
💻 LocalExpress2.198s (-1.8%)3.158s (-0.7%)0.960s101.02x
💻 LocalNitro2.229s (-0.8%)3.192s (~)0.964s101.04x
🌐 StarterNext.js (Turbopack)2.461s (~)3.010s (~)0.549s101.15x
🌐 RedisNext.js (Turbopack)2.508s (+0.6%)3.026s (~)0.518s101.17x
🐘 PostgresNext.js (Turbopack)2.553s (-4.2%)3.022s (~)0.469s101.19x
🐘 PostgresExpress2.710s (-11.4% 🟢)3.026s (-18.2% 🟢)0.316s101.26x
🐘 PostgresNitro3.127s (+6.8% 🔺)3.775s (+13.7% 🔺)0.649s81.46x
🌐 TursoNext.js (Turbopack)4.645s (~)5.181s (~)0.535s62.16x
🌐 MongoDBNext.js (Turbopack)4.790s (+4.7%)5.187s (~)0.397s62.23x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.289s (-12.1% 🟢)3.715s (-14.2% 🟢)0.427s91.00x
▲ VercelNitro3.311s (-7.8% 🟢)3.960s (-6.2% 🟢)0.649s81.01x
▲ VercelExpress3.520s (+6.0% 🔺)4.386s (+11.3% 🔺)0.866s71.07x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.344s (-2.0%)2.008s (~)0.664s151.00x
🌐 RedisNext.js (Turbopack)1.379s (+1.2%)2.011s (~)0.632s151.03x
💻 LocalExpress1.412s (-1.2%)2.006s (~)0.594s151.05x
💻 LocalNext.js (Turbopack)1.418s (+3.0%)2.012s (~)0.594s151.06x
💻 LocalNitro1.424s (+0.9%)2.005s (~)0.581s151.06x
🐘 PostgresNext.js (Turbopack)1.708s (-2.8%)2.012s (~)0.304s151.27x
🐘 PostgresExpress1.910s (+0.6%)2.010s (-3.2%)0.101s151.42x
🐘 PostgresNitro1.930s (-2.4%)2.318s (+7.6% 🔺)0.388s131.44x
🌐 MongoDBNext.js (Turbopack)2.124s (~)3.016s (~)0.892s101.58x
🌐 TursoNext.js (Turbopack)2.224s (+4.7%)3.012s (~)0.788s101.66x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.724s (+0.6%)3.678s (-2.6%)0.954s91.00x
▲ VercelNext.js (Turbopack)2.792s (-0.9%)3.731s (-4.2%)0.939s91.03x
▲ VercelExpress2.845s (+8.0% 🔺)3.906s (+11.0% 🔺)1.061s81.04x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.142s (~)3.064s (+2.9%)0.923s101.00x
💻 LocalExpress2.191s (-5.9% 🟢)3.158s (-3.4%)0.967s101.02x
💻 LocalNitro2.322s (+2.7%)3.250s (+1.1%)0.928s101.08x
🌐 StarterNext.js (Turbopack)2.441s (~)3.009s (~)0.568s101.14x
🐘 PostgresNext.js (Turbopack)2.533s (+3.2%)3.032s (~)0.499s101.18x
🌐 RedisNext.js (Turbopack)2.540s (+2.6%)3.050s (+1.2%)0.510s101.19x
🐘 PostgresNitro2.634s (+2.0%)3.019s (~)0.386s101.23x
🐘 PostgresExpress2.734s (~)3.013s (~)0.278s101.28x
🌐 MongoDBNext.js (Turbopack)4.708s (-1.6%)5.184s (~)0.475s62.20x
🌐 TursoNext.js (Turbopack)4.724s (-2.3%)5.183s (-3.1%)0.459s62.21x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.956s (-8.2% 🟢)3.724s (+1.1%)0.768s91.00x
▲ VercelNitro3.087s (-3.5%)3.742s (-3.8%)0.654s91.04x
▲ VercelNext.js (Turbopack)3.104s (+0.6%)3.687s (-4.9%)0.583s91.05x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.124s (-3.3%)1.005s (~)0.000s (+100.0% 🔺)1.013s (~)0.889s101.00x
💻 LocalNext.js (Turbopack)0.144s (+2.1%)1.003s (~)0.017s (+2.4%)1.029s (~)0.885s101.16x
🌐 RedisNext.js (Turbopack)0.145s (-1.4%)1.004s (~)0.000s (NaN%)1.014s (~)0.869s101.17x
💻 LocalExpress0.171s (-3.8%)0.992s (~)0.014s (-6.5% 🟢)1.021s (~)0.850s101.38x
💻 LocalNitro0.179s (+1.5%)0.992s (~)0.014s (-1.4%)1.021s (~)0.842s101.44x
🌐 TursoNext.js (Turbopack)0.466s (-9.2% 🟢)0.985s (+5.4% 🔺)0.000s (NaN%)1.013s (~)0.548s103.75x
🌐 MongoDBNext.js (Turbopack)0.479s (-9.3% 🟢)0.970s (+5.5% 🔺)0.000s (~)1.016s (~)0.537s103.87x
🐘 PostgresNext.js (Turbopack)0.811s (-44.3% 🟢)0.847s (-49.1% 🟢)0.001s (+Infinity% 🔺)1.018s (-49.5% 🟢)0.207s106.54x
🐘 PostgresNitro2.169s (-5.3% 🟢)2.877s (+4.5%)0.000s (-33.3% 🟢)3.014s (~)0.846s1017.49x
🐘 PostgresExpress2.335s (+2.4%)2.708s (-2.0%)0.000s (+Infinity% 🔺)3.016s (~)0.680s1018.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.668s (+4.7%)3.144s (+2.4%)0.363s (-21.2% 🟢)3.992s (+1.1%)1.324s101.00x
▲ VercelNext.js (Turbopack)2.778s (+7.2% 🔺)3.294s (+2.8%)0.368s (-72.5% 🟢)4.096s (-18.1% 🟢)1.317s101.04x
▲ VercelNitro2.854s (+5.2% 🔺)3.241s (+1.7%)0.384s (+11.3% 🔺)4.065s (+1.9%)1.211s101.07x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)6/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelExpress4/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

@github-actions

github-actionsBot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production278811297
✅ 💻 Local Development23508243
✅ 📦 Local Production26208270
✅ 🐘 Local Postgres26208270
❌ 🪟 Windows027027
❌ 🌍 Community Worlds81390120
Total111874351227

❌ Failed Tests

▲ Vercel Production (8 failed)

hono (8 failed):

  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter
🪟 Windows (27 failed)

nextjs-turbopack (27 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • webhook route with invalid token
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • retryAttemptCounterWorkflow
  • retryableAndFatalErrorWorkflow
  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter
🌍 Community Worlds (39 failed)

mongodb-dev (3 failed):

  • dev e2e should rebuild on step change
  • dev e2e should rebuild on workflow change
  • dev e2e should rebuild on adding workflow file

mongodb (27 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • webhook route with invalid token
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • retryAttemptCounterWorkflow
  • retryableAndFatalErrorWorkflow
  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter

starter (8 failed):

  • addTenWorkflow
  • addTenWorkflow
  • retryAttemptCounterWorkflow
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

turso (1 failed):

  • webhookWorkflow

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro2601
✅ example2601
✅ express2601
✅ fastify2601
❌ hono1881
✅ nextjs-turbopack2601
✅ nextjs-webpack2601
✅ nitro2601
✅ nuxt2601
✅ sveltekit2601
✅ vite2601
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
❌ 🪟 Windows
AppPassedFailedSkipped
❌ nextjs-turbopack0270
❌ 🌍 Community Worlds
AppPassedFailedSkipped
❌ mongodb-dev030
❌ mongodb0270
✅ redis-dev300
✅ redis2700
✅ starter-dev300
❌ starter1980
✅ turso-dev300
❌ turso2610

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@VaguelySerious

VaguelySerious commented Dec 28, 2025

Copy link
Copy Markdown
Member

I'm taking over responsibility for merging this code as if I wrote it (saying this to indicate that my DCO rights should apply to this code), so I can get this merged

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@VaguelySerious

Copy link
Copy Markdown
Member

Shipped in @workflow/ai@4.0.1-beta.38

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@ctate@VaguelySerious@TooTallNate
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n 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;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Fix: Handle object-style finishReason for AI SDK v5/v6 compatibility - #695

Merged
VaguelySerious merged 10 commits into
mainfrom
ctate/fix-durable-agent-finish-reason
Dec 28, 2025
Merged

Fix: Handle object-style finishReason for AI SDK v5/v6 compatibility#695
VaguelySerious merged 10 commits into
mainfrom
ctate/fix-durable-agent-finish-reason

Conversation

@ctate

Copy link
Copy Markdown
Contributor

Users were encountering the following error when using DurableAgent with AI SDK v6:

Error: Unexpected finish reason: [object Object]
at streamTextIterator (stream-text-iterator.ts:327:12)

This occurred because AI SDK v6 (or certain providers) may return finishReason as an object with a type property (e.g., { type: 'stop' }) rather than a plain string like 'stop' as in AI SDK v5.

Solution

  • Added normalization logic in stream-text-iterator.ts and do-stream-step.ts to handle both formats
  • Uses the AI SDK's FinishReason type directly from the ai package, ensuring 1:1 type compatibility with whichever version the consuming app uses (v5 or v6)
  • Improved error messaging to show the actual object value via JSON.stringify when an unexpected finish reason is encountered

@vercel

vercelBot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Dec 28, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 270e3ef

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

@github-actions

github-actionsBot commented Dec 28, 2025

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
🌐 Starter🥇 Next.js (Turbopack)0.039s (+7.2% 🔺)1.014s (~)0.975s101.00x
🌐 RedisNext.js (Turbopack)0.040s (-0.7%)1.017s (~)0.977s101.04x
💻 LocalNitro0.043s (~)1.006s (~)0.963s101.12x
💻 LocalExpress0.043s (~)1.007s (~)0.964s101.12x
💻 LocalNext.js (Turbopack)0.044s (+16.2% 🔺)1.019s (~)0.975s101.13x
🌐 TursoNext.js (Turbopack)0.098s (+22.3% 🔺)1.015s (~)0.917s102.54x
🌐 MongoDBNext.js (Turbopack)0.120s (+133.0% 🔺)1.016s (~)0.896s103.11x
🐘 PostgresNitro0.198s (-33.6% 🟢)1.024s (+1.2%)0.826s105.14x
🐘 PostgresExpress0.363s (+23.8% 🔺)1.014s (-0.5%)0.651s109.40x
🐘 PostgresNext.js (Turbopack)0.372s (+4.8%)1.022s (~)0.650s109.64x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.584s (-0.6%)1.530s (+2.8%)0.947s101.00x
▲ VercelNext.js (Turbopack)0.614s (+14.9% 🔺)1.605s (-0.6%)0.991s101.05x
▲ VercelExpress0.632s (+28.0% 🔺)1.753s (+27.6% 🔺)1.122s101.08x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.092s (+1.1%)2.009s (~)0.918s101.00x
💻 LocalNext.js (Turbopack)1.100s (+0.6%)2.011s (~)0.911s101.01x
🌐 RedisNext.js (Turbopack)1.101s (~)2.013s (~)0.912s101.01x
💻 LocalExpress1.112s (~)2.007s (~)0.895s101.02x
💻 LocalNitro1.114s (~)2.006s (~)0.892s101.02x
🌐 MongoDBNext.js (Turbopack)1.278s (-1.2%)2.015s (~)0.736s101.17x
🌐 TursoNext.js (Turbopack)1.284s (~)2.012s (~)0.728s101.18x
🐘 PostgresNext.js (Turbopack)1.598s (-31.5% 🟢)2.015s (-33.2% 🟢)0.417s101.46x
🐘 PostgresExpress2.211s (+2.5%)3.015s (~)0.804s102.03x
🐘 PostgresNitro2.365s (+9.7% 🔺)3.013s (~)0.648s102.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.648s (-1.0%)3.697s (~)1.049s101.00x
▲ VercelExpress2.745s (+1.6%)3.734s (+3.7%)0.989s101.04x
▲ VercelNitro2.779s (+11.6% 🔺)3.625s (~)0.846s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.612s (~)11.011s (~)0.399s51.00x
🌐 RedisNext.js (Turbopack)10.693s (~)11.021s (~)0.328s51.01x
💻 LocalNext.js (Turbopack)10.698s (+0.6%)11.022s (~)0.324s51.01x
💻 LocalExpress10.781s (~)11.011s (~)0.231s51.02x
💻 LocalNitro10.793s (~)11.012s (~)0.219s51.02x
🌐 MongoDBNext.js (Turbopack)12.126s (-0.5%)12.630s (-3.0%)0.505s51.14x
🌐 TursoNext.js (Turbopack)12.189s (~)13.023s (~)0.834s51.15x
🐘 PostgresNext.js (Turbopack)14.249s (-18.9% 🟢)15.040s (-17.5% 🟢)0.790s51.34x
🐘 PostgresExpress20.337s (-0.6%)21.036s (~)0.699s51.92x
🐘 PostgresNitro20.372s (-0.5%)21.037s (~)0.664s51.92x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.491s (+1.1%)22.413s (+2.0%)0.921s51.00x
▲ VercelNitro21.547s (+1.5%)22.424s (+1.9%)0.877s51.00x
▲ VercelNext.js (Turbopack)21.792s (+1.2%)22.753s (+1.1%)0.961s51.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.350s (+0.9%)2.007s (~)0.657s151.00x
🌐 RedisNext.js (Turbopack)1.371s (~)2.011s (~)0.640s151.02x
💻 LocalNext.js (Turbopack)1.398s (~)2.012s (~)0.614s151.04x
💻 LocalExpress1.399s (-1.0%)2.005s (~)0.606s151.04x
💻 LocalNitro1.412s (~)2.006s (~)0.594s151.05x
🐘 PostgresNext.js (Turbopack)1.820s (-7.2% 🟢)2.015s (-3.1%)0.194s151.35x
🌐 MongoDBNext.js (Turbopack)2.131s (-1.4%)3.017s (~)0.887s101.58x
🌐 TursoNext.js (Turbopack)2.227s (+5.0%)3.013s (~)0.786s101.65x
🐘 PostgresExpress2.380s (~)3.014s (~)0.633s101.76x
🐘 PostgresNitro2.582s (+8.7% 🔺)3.015s (~)0.433s101.91x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.782s (+3.5%)3.715s (+3.1%)0.933s91.00x
▲ VercelNitro3.002s (+6.5% 🔺)3.732s (-2.9%)0.730s91.08x
▲ VercelNext.js (Turbopack)3.399s (+15.5% 🔺)4.296s (+9.7% 🔺)0.897s81.22x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.146s (+4.6%)3.030s (+4.3%)0.884s101.00x
💻 LocalExpress2.198s (-1.8%)3.158s (-0.7%)0.960s101.02x
💻 LocalNitro2.229s (-0.8%)3.192s (~)0.964s101.04x
🌐 StarterNext.js (Turbopack)2.461s (~)3.010s (~)0.549s101.15x
🌐 RedisNext.js (Turbopack)2.508s (+0.6%)3.026s (~)0.518s101.17x
🐘 PostgresNext.js (Turbopack)2.553s (-4.2%)3.022s (~)0.469s101.19x
🐘 PostgresExpress2.710s (-11.4% 🟢)3.026s (-18.2% 🟢)0.316s101.26x
🐘 PostgresNitro3.127s (+6.8% 🔺)3.775s (+13.7% 🔺)0.649s81.46x
🌐 TursoNext.js (Turbopack)4.645s (~)5.181s (~)0.535s62.16x
🌐 MongoDBNext.js (Turbopack)4.790s (+4.7%)5.187s (~)0.397s62.23x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.289s (-12.1% 🟢)3.715s (-14.2% 🟢)0.427s91.00x
▲ VercelNitro3.311s (-7.8% 🟢)3.960s (-6.2% 🟢)0.649s81.01x
▲ VercelExpress3.520s (+6.0% 🔺)4.386s (+11.3% 🔺)0.866s71.07x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.344s (-2.0%)2.008s (~)0.664s151.00x
🌐 RedisNext.js (Turbopack)1.379s (+1.2%)2.011s (~)0.632s151.03x
💻 LocalExpress1.412s (-1.2%)2.006s (~)0.594s151.05x
💻 LocalNext.js (Turbopack)1.418s (+3.0%)2.012s (~)0.594s151.06x
💻 LocalNitro1.424s (+0.9%)2.005s (~)0.581s151.06x
🐘 PostgresNext.js (Turbopack)1.708s (-2.8%)2.012s (~)0.304s151.27x
🐘 PostgresExpress1.910s (+0.6%)2.010s (-3.2%)0.101s151.42x
🐘 PostgresNitro1.930s (-2.4%)2.318s (+7.6% 🔺)0.388s131.44x
🌐 MongoDBNext.js (Turbopack)2.124s (~)3.016s (~)0.892s101.58x
🌐 TursoNext.js (Turbopack)2.224s (+4.7%)3.012s (~)0.788s101.66x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.724s (+0.6%)3.678s (-2.6%)0.954s91.00x
▲ VercelNext.js (Turbopack)2.792s (-0.9%)3.731s (-4.2%)0.939s91.03x
▲ VercelExpress2.845s (+8.0% 🔺)3.906s (+11.0% 🔺)1.061s81.04x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.142s (~)3.064s (+2.9%)0.923s101.00x
💻 LocalExpress2.191s (-5.9% 🟢)3.158s (-3.4%)0.967s101.02x
💻 LocalNitro2.322s (+2.7%)3.250s (+1.1%)0.928s101.08x
🌐 StarterNext.js (Turbopack)2.441s (~)3.009s (~)0.568s101.14x
🐘 PostgresNext.js (Turbopack)2.533s (+3.2%)3.032s (~)0.499s101.18x
🌐 RedisNext.js (Turbopack)2.540s (+2.6%)3.050s (+1.2%)0.510s101.19x
🐘 PostgresNitro2.634s (+2.0%)3.019s (~)0.386s101.23x
🐘 PostgresExpress2.734s (~)3.013s (~)0.278s101.28x
🌐 MongoDBNext.js (Turbopack)4.708s (-1.6%)5.184s (~)0.475s62.20x
🌐 TursoNext.js (Turbopack)4.724s (-2.3%)5.183s (-3.1%)0.459s62.21x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.956s (-8.2% 🟢)3.724s (+1.1%)0.768s91.00x
▲ VercelNitro3.087s (-3.5%)3.742s (-3.8%)0.654s91.04x
▲ VercelNext.js (Turbopack)3.104s (+0.6%)3.687s (-4.9%)0.583s91.05x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.124s (-3.3%)1.005s (~)0.000s (+100.0% 🔺)1.013s (~)0.889s101.00x
💻 LocalNext.js (Turbopack)0.144s (+2.1%)1.003s (~)0.017s (+2.4%)1.029s (~)0.885s101.16x
🌐 RedisNext.js (Turbopack)0.145s (-1.4%)1.004s (~)0.000s (NaN%)1.014s (~)0.869s101.17x
💻 LocalExpress0.171s (-3.8%)0.992s (~)0.014s (-6.5% 🟢)1.021s (~)0.850s101.38x
💻 LocalNitro0.179s (+1.5%)0.992s (~)0.014s (-1.4%)1.021s (~)0.842s101.44x
🌐 TursoNext.js (Turbopack)0.466s (-9.2% 🟢)0.985s (+5.4% 🔺)0.000s (NaN%)1.013s (~)0.548s103.75x
🌐 MongoDBNext.js (Turbopack)0.479s (-9.3% 🟢)0.970s (+5.5% 🔺)0.000s (~)1.016s (~)0.537s103.87x
🐘 PostgresNext.js (Turbopack)0.811s (-44.3% 🟢)0.847s (-49.1% 🟢)0.001s (+Infinity% 🔺)1.018s (-49.5% 🟢)0.207s106.54x
🐘 PostgresNitro2.169s (-5.3% 🟢)2.877s (+4.5%)0.000s (-33.3% 🟢)3.014s (~)0.846s1017.49x
🐘 PostgresExpress2.335s (+2.4%)2.708s (-2.0%)0.000s (+Infinity% 🔺)3.016s (~)0.680s1018.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.668s (+4.7%)3.144s (+2.4%)0.363s (-21.2% 🟢)3.992s (+1.1%)1.324s101.00x
▲ VercelNext.js (Turbopack)2.778s (+7.2% 🔺)3.294s (+2.8%)0.368s (-72.5% 🟢)4.096s (-18.1% 🟢)1.317s101.04x
▲ VercelNitro2.854s (+5.2% 🔺)3.241s (+1.7%)0.384s (+11.3% 🔺)4.065s (+1.9%)1.211s101.07x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)6/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelExpress4/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

@github-actions

github-actionsBot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production278811297
✅ 💻 Local Development23508243
✅ 📦 Local Production26208270
✅ 🐘 Local Postgres26208270
❌ 🪟 Windows027027
❌ 🌍 Community Worlds81390120
Total111874351227

❌ Failed Tests

▲ Vercel Production (8 failed)

hono (8 failed):

  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter
🪟 Windows (27 failed)

nextjs-turbopack (27 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • webhook route with invalid token
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • retryAttemptCounterWorkflow
  • retryableAndFatalErrorWorkflow
  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter
🌍 Community Worlds (39 failed)

mongodb-dev (3 failed):

  • dev e2e should rebuild on step change
  • dev e2e should rebuild on workflow change
  • dev e2e should rebuild on adding workflow file

mongodb (27 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • webhook route with invalid token
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • retryAttemptCounterWorkflow
  • retryableAndFatalErrorWorkflow
  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter

starter (8 failed):

  • addTenWorkflow
  • addTenWorkflow
  • retryAttemptCounterWorkflow
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

turso (1 failed):

  • webhookWorkflow

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro2601
✅ example2601
✅ express2601
✅ fastify2601
❌ hono1881
✅ nextjs-turbopack2601
✅ nextjs-webpack2601
✅ nitro2601
✅ nuxt2601
✅ sveltekit2601
✅ vite2601
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
❌ 🪟 Windows
AppPassedFailedSkipped
❌ nextjs-turbopack0270
❌ 🌍 Community Worlds
AppPassedFailedSkipped
❌ mongodb-dev030
❌ mongodb0270
✅ redis-dev300
✅ redis2700
✅ starter-dev300
❌ starter1980
✅ turso-dev300
❌ turso2610

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@VaguelySerious

VaguelySerious commented Dec 28, 2025

Copy link
Copy Markdown
Member

I'm taking over responsibility for merging this code as if I wrote it (saying this to indicate that my DCO rights should apply to this code), so I can get this merged

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@VaguelySerious

Copy link
Copy Markdown
Member

Shipped in @workflow/ai@4.0.1-beta.38

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

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

Fix: Handle object-style finishReason for AI SDK v5/v6 compatibility - #695

Merged
VaguelySerious merged 10 commits into
mainfrom
ctate/fix-durable-agent-finish-reason
Dec 28, 2025
Merged

Fix: Handle object-style finishReason for AI SDK v5/v6 compatibility#695
VaguelySerious merged 10 commits into
mainfrom
ctate/fix-durable-agent-finish-reason

Conversation

@ctate

Copy link
Copy Markdown
Contributor

Users were encountering the following error when using DurableAgent with AI SDK v6:

Error: Unexpected finish reason: [object Object]
at streamTextIterator (stream-text-iterator.ts:327:12)

This occurred because AI SDK v6 (or certain providers) may return finishReason as an object with a type property (e.g., { type: 'stop' }) rather than a plain string like 'stop' as in AI SDK v5.

Solution

  • Added normalization logic in stream-text-iterator.ts and do-stream-step.ts to handle both formats
  • Uses the AI SDK's FinishReason type directly from the ai package, ensuring 1:1 type compatibility with whichever version the consuming app uses (v5 or v6)
  • Improved error messaging to show the actual object value via JSON.stringify when an unexpected finish reason is encountered

@vercel

vercelBot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Dec 28, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 270e3ef

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

@github-actions

github-actionsBot commented Dec 28, 2025

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
🌐 Starter🥇 Next.js (Turbopack)0.039s (+7.2% 🔺)1.014s (~)0.975s101.00x
🌐 RedisNext.js (Turbopack)0.040s (-0.7%)1.017s (~)0.977s101.04x
💻 LocalNitro0.043s (~)1.006s (~)0.963s101.12x
💻 LocalExpress0.043s (~)1.007s (~)0.964s101.12x
💻 LocalNext.js (Turbopack)0.044s (+16.2% 🔺)1.019s (~)0.975s101.13x
🌐 TursoNext.js (Turbopack)0.098s (+22.3% 🔺)1.015s (~)0.917s102.54x
🌐 MongoDBNext.js (Turbopack)0.120s (+133.0% 🔺)1.016s (~)0.896s103.11x
🐘 PostgresNitro0.198s (-33.6% 🟢)1.024s (+1.2%)0.826s105.14x
🐘 PostgresExpress0.363s (+23.8% 🔺)1.014s (-0.5%)0.651s109.40x
🐘 PostgresNext.js (Turbopack)0.372s (+4.8%)1.022s (~)0.650s109.64x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.584s (-0.6%)1.530s (+2.8%)0.947s101.00x
▲ VercelNext.js (Turbopack)0.614s (+14.9% 🔺)1.605s (-0.6%)0.991s101.05x
▲ VercelExpress0.632s (+28.0% 🔺)1.753s (+27.6% 🔺)1.122s101.08x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.092s (+1.1%)2.009s (~)0.918s101.00x
💻 LocalNext.js (Turbopack)1.100s (+0.6%)2.011s (~)0.911s101.01x
🌐 RedisNext.js (Turbopack)1.101s (~)2.013s (~)0.912s101.01x
💻 LocalExpress1.112s (~)2.007s (~)0.895s101.02x
💻 LocalNitro1.114s (~)2.006s (~)0.892s101.02x
🌐 MongoDBNext.js (Turbopack)1.278s (-1.2%)2.015s (~)0.736s101.17x
🌐 TursoNext.js (Turbopack)1.284s (~)2.012s (~)0.728s101.18x
🐘 PostgresNext.js (Turbopack)1.598s (-31.5% 🟢)2.015s (-33.2% 🟢)0.417s101.46x
🐘 PostgresExpress2.211s (+2.5%)3.015s (~)0.804s102.03x
🐘 PostgresNitro2.365s (+9.7% 🔺)3.013s (~)0.648s102.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.648s (-1.0%)3.697s (~)1.049s101.00x
▲ VercelExpress2.745s (+1.6%)3.734s (+3.7%)0.989s101.04x
▲ VercelNitro2.779s (+11.6% 🔺)3.625s (~)0.846s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.612s (~)11.011s (~)0.399s51.00x
🌐 RedisNext.js (Turbopack)10.693s (~)11.021s (~)0.328s51.01x
💻 LocalNext.js (Turbopack)10.698s (+0.6%)11.022s (~)0.324s51.01x
💻 LocalExpress10.781s (~)11.011s (~)0.231s51.02x
💻 LocalNitro10.793s (~)11.012s (~)0.219s51.02x
🌐 MongoDBNext.js (Turbopack)12.126s (-0.5%)12.630s (-3.0%)0.505s51.14x
🌐 TursoNext.js (Turbopack)12.189s (~)13.023s (~)0.834s51.15x
🐘 PostgresNext.js (Turbopack)14.249s (-18.9% 🟢)15.040s (-17.5% 🟢)0.790s51.34x
🐘 PostgresExpress20.337s (-0.6%)21.036s (~)0.699s51.92x
🐘 PostgresNitro20.372s (-0.5%)21.037s (~)0.664s51.92x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.491s (+1.1%)22.413s (+2.0%)0.921s51.00x
▲ VercelNitro21.547s (+1.5%)22.424s (+1.9%)0.877s51.00x
▲ VercelNext.js (Turbopack)21.792s (+1.2%)22.753s (+1.1%)0.961s51.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.350s (+0.9%)2.007s (~)0.657s151.00x
🌐 RedisNext.js (Turbopack)1.371s (~)2.011s (~)0.640s151.02x
💻 LocalNext.js (Turbopack)1.398s (~)2.012s (~)0.614s151.04x
💻 LocalExpress1.399s (-1.0%)2.005s (~)0.606s151.04x
💻 LocalNitro1.412s (~)2.006s (~)0.594s151.05x
🐘 PostgresNext.js (Turbopack)1.820s (-7.2% 🟢)2.015s (-3.1%)0.194s151.35x
🌐 MongoDBNext.js (Turbopack)2.131s (-1.4%)3.017s (~)0.887s101.58x
🌐 TursoNext.js (Turbopack)2.227s (+5.0%)3.013s (~)0.786s101.65x
🐘 PostgresExpress2.380s (~)3.014s (~)0.633s101.76x
🐘 PostgresNitro2.582s (+8.7% 🔺)3.015s (~)0.433s101.91x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.782s (+3.5%)3.715s (+3.1%)0.933s91.00x
▲ VercelNitro3.002s (+6.5% 🔺)3.732s (-2.9%)0.730s91.08x
▲ VercelNext.js (Turbopack)3.399s (+15.5% 🔺)4.296s (+9.7% 🔺)0.897s81.22x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.146s (+4.6%)3.030s (+4.3%)0.884s101.00x
💻 LocalExpress2.198s (-1.8%)3.158s (-0.7%)0.960s101.02x
💻 LocalNitro2.229s (-0.8%)3.192s (~)0.964s101.04x
🌐 StarterNext.js (Turbopack)2.461s (~)3.010s (~)0.549s101.15x
🌐 RedisNext.js (Turbopack)2.508s (+0.6%)3.026s (~)0.518s101.17x
🐘 PostgresNext.js (Turbopack)2.553s (-4.2%)3.022s (~)0.469s101.19x
🐘 PostgresExpress2.710s (-11.4% 🟢)3.026s (-18.2% 🟢)0.316s101.26x
🐘 PostgresNitro3.127s (+6.8% 🔺)3.775s (+13.7% 🔺)0.649s81.46x
🌐 TursoNext.js (Turbopack)4.645s (~)5.181s (~)0.535s62.16x
🌐 MongoDBNext.js (Turbopack)4.790s (+4.7%)5.187s (~)0.397s62.23x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.289s (-12.1% 🟢)3.715s (-14.2% 🟢)0.427s91.00x
▲ VercelNitro3.311s (-7.8% 🟢)3.960s (-6.2% 🟢)0.649s81.01x
▲ VercelExpress3.520s (+6.0% 🔺)4.386s (+11.3% 🔺)0.866s71.07x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.344s (-2.0%)2.008s (~)0.664s151.00x
🌐 RedisNext.js (Turbopack)1.379s (+1.2%)2.011s (~)0.632s151.03x
💻 LocalExpress1.412s (-1.2%)2.006s (~)0.594s151.05x
💻 LocalNext.js (Turbopack)1.418s (+3.0%)2.012s (~)0.594s151.06x
💻 LocalNitro1.424s (+0.9%)2.005s (~)0.581s151.06x
🐘 PostgresNext.js (Turbopack)1.708s (-2.8%)2.012s (~)0.304s151.27x
🐘 PostgresExpress1.910s (+0.6%)2.010s (-3.2%)0.101s151.42x
🐘 PostgresNitro1.930s (-2.4%)2.318s (+7.6% 🔺)0.388s131.44x
🌐 MongoDBNext.js (Turbopack)2.124s (~)3.016s (~)0.892s101.58x
🌐 TursoNext.js (Turbopack)2.224s (+4.7%)3.012s (~)0.788s101.66x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.724s (+0.6%)3.678s (-2.6%)0.954s91.00x
▲ VercelNext.js (Turbopack)2.792s (-0.9%)3.731s (-4.2%)0.939s91.03x
▲ VercelExpress2.845s (+8.0% 🔺)3.906s (+11.0% 🔺)1.061s81.04x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.142s (~)3.064s (+2.9%)0.923s101.00x
💻 LocalExpress2.191s (-5.9% 🟢)3.158s (-3.4%)0.967s101.02x
💻 LocalNitro2.322s (+2.7%)3.250s (+1.1%)0.928s101.08x
🌐 StarterNext.js (Turbopack)2.441s (~)3.009s (~)0.568s101.14x
🐘 PostgresNext.js (Turbopack)2.533s (+3.2%)3.032s (~)0.499s101.18x
🌐 RedisNext.js (Turbopack)2.540s (+2.6%)3.050s (+1.2%)0.510s101.19x
🐘 PostgresNitro2.634s (+2.0%)3.019s (~)0.386s101.23x
🐘 PostgresExpress2.734s (~)3.013s (~)0.278s101.28x
🌐 MongoDBNext.js (Turbopack)4.708s (-1.6%)5.184s (~)0.475s62.20x
🌐 TursoNext.js (Turbopack)4.724s (-2.3%)5.183s (-3.1%)0.459s62.21x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.956s (-8.2% 🟢)3.724s (+1.1%)0.768s91.00x
▲ VercelNitro3.087s (-3.5%)3.742s (-3.8%)0.654s91.04x
▲ VercelNext.js (Turbopack)3.104s (+0.6%)3.687s (-4.9%)0.583s91.05x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.124s (-3.3%)1.005s (~)0.000s (+100.0% 🔺)1.013s (~)0.889s101.00x
💻 LocalNext.js (Turbopack)0.144s (+2.1%)1.003s (~)0.017s (+2.4%)1.029s (~)0.885s101.16x
🌐 RedisNext.js (Turbopack)0.145s (-1.4%)1.004s (~)0.000s (NaN%)1.014s (~)0.869s101.17x
💻 LocalExpress0.171s (-3.8%)0.992s (~)0.014s (-6.5% 🟢)1.021s (~)0.850s101.38x
💻 LocalNitro0.179s (+1.5%)0.992s (~)0.014s (-1.4%)1.021s (~)0.842s101.44x
🌐 TursoNext.js (Turbopack)0.466s (-9.2% 🟢)0.985s (+5.4% 🔺)0.000s (NaN%)1.013s (~)0.548s103.75x
🌐 MongoDBNext.js (Turbopack)0.479s (-9.3% 🟢)0.970s (+5.5% 🔺)0.000s (~)1.016s (~)0.537s103.87x
🐘 PostgresNext.js (Turbopack)0.811s (-44.3% 🟢)0.847s (-49.1% 🟢)0.001s (+Infinity% 🔺)1.018s (-49.5% 🟢)0.207s106.54x
🐘 PostgresNitro2.169s (-5.3% 🟢)2.877s (+4.5%)0.000s (-33.3% 🟢)3.014s (~)0.846s1017.49x
🐘 PostgresExpress2.335s (+2.4%)2.708s (-2.0%)0.000s (+Infinity% 🔺)3.016s (~)0.680s1018.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.668s (+4.7%)3.144s (+2.4%)0.363s (-21.2% 🟢)3.992s (+1.1%)1.324s101.00x
▲ VercelNext.js (Turbopack)2.778s (+7.2% 🔺)3.294s (+2.8%)0.368s (-72.5% 🟢)4.096s (-18.1% 🟢)1.317s101.04x
▲ VercelNitro2.854s (+5.2% 🔺)3.241s (+1.7%)0.384s (+11.3% 🔺)4.065s (+1.9%)1.211s101.07x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)6/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelExpress4/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

@github-actions

github-actionsBot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production278811297
✅ 💻 Local Development23508243
✅ 📦 Local Production26208270
✅ 🐘 Local Postgres26208270
❌ 🪟 Windows027027
❌ 🌍 Community Worlds81390120
Total111874351227

❌ Failed Tests

▲ Vercel Production (8 failed)

hono (8 failed):

  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter
🪟 Windows (27 failed)

nextjs-turbopack (27 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • webhook route with invalid token
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • retryAttemptCounterWorkflow
  • retryableAndFatalErrorWorkflow
  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter
🌍 Community Worlds (39 failed)

mongodb-dev (3 failed):

  • dev e2e should rebuild on step change
  • dev e2e should rebuild on workflow change
  • dev e2e should rebuild on adding workflow file

mongodb (27 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • webhook route with invalid token
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • retryAttemptCounterWorkflow
  • retryableAndFatalErrorWorkflow
  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter

starter (8 failed):

  • addTenWorkflow
  • addTenWorkflow
  • retryAttemptCounterWorkflow
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

turso (1 failed):

  • webhookWorkflow

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro2601
✅ example2601
✅ express2601
✅ fastify2601
❌ hono1881
✅ nextjs-turbopack2601
✅ nextjs-webpack2601
✅ nitro2601
✅ nuxt2601
✅ sveltekit2601
✅ vite2601
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
❌ 🪟 Windows
AppPassedFailedSkipped
❌ nextjs-turbopack0270
❌ 🌍 Community Worlds
AppPassedFailedSkipped
❌ mongodb-dev030
❌ mongodb0270
✅ redis-dev300
✅ redis2700
✅ starter-dev300
❌ starter1980
✅ turso-dev300
❌ turso2610

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@VaguelySerious

VaguelySerious commented Dec 28, 2025

Copy link
Copy Markdown
Member

I'm taking over responsibility for merging this code as if I wrote it (saying this to indicate that my DCO rights should apply to this code), so I can get this merged

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@VaguelySerious

Copy link
Copy Markdown
Member

Shipped in @workflow/ai@4.0.1-beta.38

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

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

Fix: Handle object-style finishReason for AI SDK v5/v6 compatibility - #695

Merged
VaguelySerious merged 10 commits into
mainfrom
ctate/fix-durable-agent-finish-reason
Dec 28, 2025
Merged

Fix: Handle object-style finishReason for AI SDK v5/v6 compatibility#695
VaguelySerious merged 10 commits into
mainfrom
ctate/fix-durable-agent-finish-reason

Conversation

@ctate

Copy link
Copy Markdown
Contributor

Users were encountering the following error when using DurableAgent with AI SDK v6:

Error: Unexpected finish reason: [object Object]
at streamTextIterator (stream-text-iterator.ts:327:12)

This occurred because AI SDK v6 (or certain providers) may return finishReason as an object with a type property (e.g., { type: 'stop' }) rather than a plain string like 'stop' as in AI SDK v5.

Solution

  • Added normalization logic in stream-text-iterator.ts and do-stream-step.ts to handle both formats
  • Uses the AI SDK's FinishReason type directly from the ai package, ensuring 1:1 type compatibility with whichever version the consuming app uses (v5 or v6)
  • Improved error messaging to show the actual object value via JSON.stringify when an unexpected finish reason is encountered

@vercel

vercelBot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Dec 28, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 270e3ef

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

@github-actions

github-actionsBot commented Dec 28, 2025

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
🌐 Starter🥇 Next.js (Turbopack)0.039s (+7.2% 🔺)1.014s (~)0.975s101.00x
🌐 RedisNext.js (Turbopack)0.040s (-0.7%)1.017s (~)0.977s101.04x
💻 LocalNitro0.043s (~)1.006s (~)0.963s101.12x
💻 LocalExpress0.043s (~)1.007s (~)0.964s101.12x
💻 LocalNext.js (Turbopack)0.044s (+16.2% 🔺)1.019s (~)0.975s101.13x
🌐 TursoNext.js (Turbopack)0.098s (+22.3% 🔺)1.015s (~)0.917s102.54x
🌐 MongoDBNext.js (Turbopack)0.120s (+133.0% 🔺)1.016s (~)0.896s103.11x
🐘 PostgresNitro0.198s (-33.6% 🟢)1.024s (+1.2%)0.826s105.14x
🐘 PostgresExpress0.363s (+23.8% 🔺)1.014s (-0.5%)0.651s109.40x
🐘 PostgresNext.js (Turbopack)0.372s (+4.8%)1.022s (~)0.650s109.64x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.584s (-0.6%)1.530s (+2.8%)0.947s101.00x
▲ VercelNext.js (Turbopack)0.614s (+14.9% 🔺)1.605s (-0.6%)0.991s101.05x
▲ VercelExpress0.632s (+28.0% 🔺)1.753s (+27.6% 🔺)1.122s101.08x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.092s (+1.1%)2.009s (~)0.918s101.00x
💻 LocalNext.js (Turbopack)1.100s (+0.6%)2.011s (~)0.911s101.01x
🌐 RedisNext.js (Turbopack)1.101s (~)2.013s (~)0.912s101.01x
💻 LocalExpress1.112s (~)2.007s (~)0.895s101.02x
💻 LocalNitro1.114s (~)2.006s (~)0.892s101.02x
🌐 MongoDBNext.js (Turbopack)1.278s (-1.2%)2.015s (~)0.736s101.17x
🌐 TursoNext.js (Turbopack)1.284s (~)2.012s (~)0.728s101.18x
🐘 PostgresNext.js (Turbopack)1.598s (-31.5% 🟢)2.015s (-33.2% 🟢)0.417s101.46x
🐘 PostgresExpress2.211s (+2.5%)3.015s (~)0.804s102.03x
🐘 PostgresNitro2.365s (+9.7% 🔺)3.013s (~)0.648s102.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.648s (-1.0%)3.697s (~)1.049s101.00x
▲ VercelExpress2.745s (+1.6%)3.734s (+3.7%)0.989s101.04x
▲ VercelNitro2.779s (+11.6% 🔺)3.625s (~)0.846s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.612s (~)11.011s (~)0.399s51.00x
🌐 RedisNext.js (Turbopack)10.693s (~)11.021s (~)0.328s51.01x
💻 LocalNext.js (Turbopack)10.698s (+0.6%)11.022s (~)0.324s51.01x
💻 LocalExpress10.781s (~)11.011s (~)0.231s51.02x
💻 LocalNitro10.793s (~)11.012s (~)0.219s51.02x
🌐 MongoDBNext.js (Turbopack)12.126s (-0.5%)12.630s (-3.0%)0.505s51.14x
🌐 TursoNext.js (Turbopack)12.189s (~)13.023s (~)0.834s51.15x
🐘 PostgresNext.js (Turbopack)14.249s (-18.9% 🟢)15.040s (-17.5% 🟢)0.790s51.34x
🐘 PostgresExpress20.337s (-0.6%)21.036s (~)0.699s51.92x
🐘 PostgresNitro20.372s (-0.5%)21.037s (~)0.664s51.92x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.491s (+1.1%)22.413s (+2.0%)0.921s51.00x
▲ VercelNitro21.547s (+1.5%)22.424s (+1.9%)0.877s51.00x
▲ VercelNext.js (Turbopack)21.792s (+1.2%)22.753s (+1.1%)0.961s51.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.350s (+0.9%)2.007s (~)0.657s151.00x
🌐 RedisNext.js (Turbopack)1.371s (~)2.011s (~)0.640s151.02x
💻 LocalNext.js (Turbopack)1.398s (~)2.012s (~)0.614s151.04x
💻 LocalExpress1.399s (-1.0%)2.005s (~)0.606s151.04x
💻 LocalNitro1.412s (~)2.006s (~)0.594s151.05x
🐘 PostgresNext.js (Turbopack)1.820s (-7.2% 🟢)2.015s (-3.1%)0.194s151.35x
🌐 MongoDBNext.js (Turbopack)2.131s (-1.4%)3.017s (~)0.887s101.58x
🌐 TursoNext.js (Turbopack)2.227s (+5.0%)3.013s (~)0.786s101.65x
🐘 PostgresExpress2.380s (~)3.014s (~)0.633s101.76x
🐘 PostgresNitro2.582s (+8.7% 🔺)3.015s (~)0.433s101.91x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.782s (+3.5%)3.715s (+3.1%)0.933s91.00x
▲ VercelNitro3.002s (+6.5% 🔺)3.732s (-2.9%)0.730s91.08x
▲ VercelNext.js (Turbopack)3.399s (+15.5% 🔺)4.296s (+9.7% 🔺)0.897s81.22x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.146s (+4.6%)3.030s (+4.3%)0.884s101.00x
💻 LocalExpress2.198s (-1.8%)3.158s (-0.7%)0.960s101.02x
💻 LocalNitro2.229s (-0.8%)3.192s (~)0.964s101.04x
🌐 StarterNext.js (Turbopack)2.461s (~)3.010s (~)0.549s101.15x
🌐 RedisNext.js (Turbopack)2.508s (+0.6%)3.026s (~)0.518s101.17x
🐘 PostgresNext.js (Turbopack)2.553s (-4.2%)3.022s (~)0.469s101.19x
🐘 PostgresExpress2.710s (-11.4% 🟢)3.026s (-18.2% 🟢)0.316s101.26x
🐘 PostgresNitro3.127s (+6.8% 🔺)3.775s (+13.7% 🔺)0.649s81.46x
🌐 TursoNext.js (Turbopack)4.645s (~)5.181s (~)0.535s62.16x
🌐 MongoDBNext.js (Turbopack)4.790s (+4.7%)5.187s (~)0.397s62.23x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.289s (-12.1% 🟢)3.715s (-14.2% 🟢)0.427s91.00x
▲ VercelNitro3.311s (-7.8% 🟢)3.960s (-6.2% 🟢)0.649s81.01x
▲ VercelExpress3.520s (+6.0% 🔺)4.386s (+11.3% 🔺)0.866s71.07x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.344s (-2.0%)2.008s (~)0.664s151.00x
🌐 RedisNext.js (Turbopack)1.379s (+1.2%)2.011s (~)0.632s151.03x
💻 LocalExpress1.412s (-1.2%)2.006s (~)0.594s151.05x
💻 LocalNext.js (Turbopack)1.418s (+3.0%)2.012s (~)0.594s151.06x
💻 LocalNitro1.424s (+0.9%)2.005s (~)0.581s151.06x
🐘 PostgresNext.js (Turbopack)1.708s (-2.8%)2.012s (~)0.304s151.27x
🐘 PostgresExpress1.910s (+0.6%)2.010s (-3.2%)0.101s151.42x
🐘 PostgresNitro1.930s (-2.4%)2.318s (+7.6% 🔺)0.388s131.44x
🌐 MongoDBNext.js (Turbopack)2.124s (~)3.016s (~)0.892s101.58x
🌐 TursoNext.js (Turbopack)2.224s (+4.7%)3.012s (~)0.788s101.66x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.724s (+0.6%)3.678s (-2.6%)0.954s91.00x
▲ VercelNext.js (Turbopack)2.792s (-0.9%)3.731s (-4.2%)0.939s91.03x
▲ VercelExpress2.845s (+8.0% 🔺)3.906s (+11.0% 🔺)1.061s81.04x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.142s (~)3.064s (+2.9%)0.923s101.00x
💻 LocalExpress2.191s (-5.9% 🟢)3.158s (-3.4%)0.967s101.02x
💻 LocalNitro2.322s (+2.7%)3.250s (+1.1%)0.928s101.08x
🌐 StarterNext.js (Turbopack)2.441s (~)3.009s (~)0.568s101.14x
🐘 PostgresNext.js (Turbopack)2.533s (+3.2%)3.032s (~)0.499s101.18x
🌐 RedisNext.js (Turbopack)2.540s (+2.6%)3.050s (+1.2%)0.510s101.19x
🐘 PostgresNitro2.634s (+2.0%)3.019s (~)0.386s101.23x
🐘 PostgresExpress2.734s (~)3.013s (~)0.278s101.28x
🌐 MongoDBNext.js (Turbopack)4.708s (-1.6%)5.184s (~)0.475s62.20x
🌐 TursoNext.js (Turbopack)4.724s (-2.3%)5.183s (-3.1%)0.459s62.21x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.956s (-8.2% 🟢)3.724s (+1.1%)0.768s91.00x
▲ VercelNitro3.087s (-3.5%)3.742s (-3.8%)0.654s91.04x
▲ VercelNext.js (Turbopack)3.104s (+0.6%)3.687s (-4.9%)0.583s91.05x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.124s (-3.3%)1.005s (~)0.000s (+100.0% 🔺)1.013s (~)0.889s101.00x
💻 LocalNext.js (Turbopack)0.144s (+2.1%)1.003s (~)0.017s (+2.4%)1.029s (~)0.885s101.16x
🌐 RedisNext.js (Turbopack)0.145s (-1.4%)1.004s (~)0.000s (NaN%)1.014s (~)0.869s101.17x
💻 LocalExpress0.171s (-3.8%)0.992s (~)0.014s (-6.5% 🟢)1.021s (~)0.850s101.38x
💻 LocalNitro0.179s (+1.5%)0.992s (~)0.014s (-1.4%)1.021s (~)0.842s101.44x
🌐 TursoNext.js (Turbopack)0.466s (-9.2% 🟢)0.985s (+5.4% 🔺)0.000s (NaN%)1.013s (~)0.548s103.75x
🌐 MongoDBNext.js (Turbopack)0.479s (-9.3% 🟢)0.970s (+5.5% 🔺)0.000s (~)1.016s (~)0.537s103.87x
🐘 PostgresNext.js (Turbopack)0.811s (-44.3% 🟢)0.847s (-49.1% 🟢)0.001s (+Infinity% 🔺)1.018s (-49.5% 🟢)0.207s106.54x
🐘 PostgresNitro2.169s (-5.3% 🟢)2.877s (+4.5%)0.000s (-33.3% 🟢)3.014s (~)0.846s1017.49x
🐘 PostgresExpress2.335s (+2.4%)2.708s (-2.0%)0.000s (+Infinity% 🔺)3.016s (~)0.680s1018.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.668s (+4.7%)3.144s (+2.4%)0.363s (-21.2% 🟢)3.992s (+1.1%)1.324s101.00x
▲ VercelNext.js (Turbopack)2.778s (+7.2% 🔺)3.294s (+2.8%)0.368s (-72.5% 🟢)4.096s (-18.1% 🟢)1.317s101.04x
▲ VercelNitro2.854s (+5.2% 🔺)3.241s (+1.7%)0.384s (+11.3% 🔺)4.065s (+1.9%)1.211s101.07x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)6/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelExpress4/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

@github-actions

github-actionsBot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production278811297
✅ 💻 Local Development23508243
✅ 📦 Local Production26208270
✅ 🐘 Local Postgres26208270
❌ 🪟 Windows027027
❌ 🌍 Community Worlds81390120
Total111874351227

❌ Failed Tests

▲ Vercel Production (8 failed)

hono (8 failed):

  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter
🪟 Windows (27 failed)

nextjs-turbopack (27 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • webhook route with invalid token
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • retryAttemptCounterWorkflow
  • retryableAndFatalErrorWorkflow
  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter
🌍 Community Worlds (39 failed)

mongodb-dev (3 failed):

  • dev e2e should rebuild on step change
  • dev e2e should rebuild on workflow change
  • dev e2e should rebuild on adding workflow file

mongodb (27 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • webhook route with invalid token
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • retryAttemptCounterWorkflow
  • retryableAndFatalErrorWorkflow
  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter

starter (8 failed):

  • addTenWorkflow
  • addTenWorkflow
  • retryAttemptCounterWorkflow
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

turso (1 failed):

  • webhookWorkflow

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro2601
✅ example2601
✅ express2601
✅ fastify2601
❌ hono1881
✅ nextjs-turbopack2601
✅ nextjs-webpack2601
✅ nitro2601
✅ nuxt2601
✅ sveltekit2601
✅ vite2601
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
❌ 🪟 Windows
AppPassedFailedSkipped
❌ nextjs-turbopack0270
❌ 🌍 Community Worlds
AppPassedFailedSkipped
❌ mongodb-dev030
❌ mongodb0270
✅ redis-dev300
✅ redis2700
✅ starter-dev300
❌ starter1980
✅ turso-dev300
❌ turso2610

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@VaguelySerious

VaguelySerious commented Dec 28, 2025

Copy link
Copy Markdown
Member

I'm taking over responsibility for merging this code as if I wrote it (saying this to indicate that my DCO rights should apply to this code), so I can get this merged

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@VaguelySerious

Copy link
Copy Markdown
Member

Shipped in @workflow/ai@4.0.1-beta.38

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

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

Fix: Handle object-style finishReason for AI SDK v5/v6 compatibility - #695

Merged
VaguelySerious merged 10 commits into
mainfrom
ctate/fix-durable-agent-finish-reason
Dec 28, 2025
Merged

Fix: Handle object-style finishReason for AI SDK v5/v6 compatibility#695
VaguelySerious merged 10 commits into
mainfrom
ctate/fix-durable-agent-finish-reason

Conversation

@ctate

Copy link
Copy Markdown
Contributor

Users were encountering the following error when using DurableAgent with AI SDK v6:

Error: Unexpected finish reason: [object Object]
at streamTextIterator (stream-text-iterator.ts:327:12)

This occurred because AI SDK v6 (or certain providers) may return finishReason as an object with a type property (e.g., { type: 'stop' }) rather than a plain string like 'stop' as in AI SDK v5.

Solution

  • Added normalization logic in stream-text-iterator.ts and do-stream-step.ts to handle both formats
  • Uses the AI SDK's FinishReason type directly from the ai package, ensuring 1:1 type compatibility with whichever version the consuming app uses (v5 or v6)
  • Improved error messaging to show the actual object value via JSON.stringify when an unexpected finish reason is encountered

@vercel

vercelBot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Dec 28, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 270e3ef

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

@github-actions

github-actionsBot commented Dec 28, 2025

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
🌐 Starter🥇 Next.js (Turbopack)0.039s (+7.2% 🔺)1.014s (~)0.975s101.00x
🌐 RedisNext.js (Turbopack)0.040s (-0.7%)1.017s (~)0.977s101.04x
💻 LocalNitro0.043s (~)1.006s (~)0.963s101.12x
💻 LocalExpress0.043s (~)1.007s (~)0.964s101.12x
💻 LocalNext.js (Turbopack)0.044s (+16.2% 🔺)1.019s (~)0.975s101.13x
🌐 TursoNext.js (Turbopack)0.098s (+22.3% 🔺)1.015s (~)0.917s102.54x
🌐 MongoDBNext.js (Turbopack)0.120s (+133.0% 🔺)1.016s (~)0.896s103.11x
🐘 PostgresNitro0.198s (-33.6% 🟢)1.024s (+1.2%)0.826s105.14x
🐘 PostgresExpress0.363s (+23.8% 🔺)1.014s (-0.5%)0.651s109.40x
🐘 PostgresNext.js (Turbopack)0.372s (+4.8%)1.022s (~)0.650s109.64x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.584s (-0.6%)1.530s (+2.8%)0.947s101.00x
▲ VercelNext.js (Turbopack)0.614s (+14.9% 🔺)1.605s (-0.6%)0.991s101.05x
▲ VercelExpress0.632s (+28.0% 🔺)1.753s (+27.6% 🔺)1.122s101.08x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.092s (+1.1%)2.009s (~)0.918s101.00x
💻 LocalNext.js (Turbopack)1.100s (+0.6%)2.011s (~)0.911s101.01x
🌐 RedisNext.js (Turbopack)1.101s (~)2.013s (~)0.912s101.01x
💻 LocalExpress1.112s (~)2.007s (~)0.895s101.02x
💻 LocalNitro1.114s (~)2.006s (~)0.892s101.02x
🌐 MongoDBNext.js (Turbopack)1.278s (-1.2%)2.015s (~)0.736s101.17x
🌐 TursoNext.js (Turbopack)1.284s (~)2.012s (~)0.728s101.18x
🐘 PostgresNext.js (Turbopack)1.598s (-31.5% 🟢)2.015s (-33.2% 🟢)0.417s101.46x
🐘 PostgresExpress2.211s (+2.5%)3.015s (~)0.804s102.03x
🐘 PostgresNitro2.365s (+9.7% 🔺)3.013s (~)0.648s102.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.648s (-1.0%)3.697s (~)1.049s101.00x
▲ VercelExpress2.745s (+1.6%)3.734s (+3.7%)0.989s101.04x
▲ VercelNitro2.779s (+11.6% 🔺)3.625s (~)0.846s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.612s (~)11.011s (~)0.399s51.00x
🌐 RedisNext.js (Turbopack)10.693s (~)11.021s (~)0.328s51.01x
💻 LocalNext.js (Turbopack)10.698s (+0.6%)11.022s (~)0.324s51.01x
💻 LocalExpress10.781s (~)11.011s (~)0.231s51.02x
💻 LocalNitro10.793s (~)11.012s (~)0.219s51.02x
🌐 MongoDBNext.js (Turbopack)12.126s (-0.5%)12.630s (-3.0%)0.505s51.14x
🌐 TursoNext.js (Turbopack)12.189s (~)13.023s (~)0.834s51.15x
🐘 PostgresNext.js (Turbopack)14.249s (-18.9% 🟢)15.040s (-17.5% 🟢)0.790s51.34x
🐘 PostgresExpress20.337s (-0.6%)21.036s (~)0.699s51.92x
🐘 PostgresNitro20.372s (-0.5%)21.037s (~)0.664s51.92x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.491s (+1.1%)22.413s (+2.0%)0.921s51.00x
▲ VercelNitro21.547s (+1.5%)22.424s (+1.9%)0.877s51.00x
▲ VercelNext.js (Turbopack)21.792s (+1.2%)22.753s (+1.1%)0.961s51.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.350s (+0.9%)2.007s (~)0.657s151.00x
🌐 RedisNext.js (Turbopack)1.371s (~)2.011s (~)0.640s151.02x
💻 LocalNext.js (Turbopack)1.398s (~)2.012s (~)0.614s151.04x
💻 LocalExpress1.399s (-1.0%)2.005s (~)0.606s151.04x
💻 LocalNitro1.412s (~)2.006s (~)0.594s151.05x
🐘 PostgresNext.js (Turbopack)1.820s (-7.2% 🟢)2.015s (-3.1%)0.194s151.35x
🌐 MongoDBNext.js (Turbopack)2.131s (-1.4%)3.017s (~)0.887s101.58x
🌐 TursoNext.js (Turbopack)2.227s (+5.0%)3.013s (~)0.786s101.65x
🐘 PostgresExpress2.380s (~)3.014s (~)0.633s101.76x
🐘 PostgresNitro2.582s (+8.7% 🔺)3.015s (~)0.433s101.91x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.782s (+3.5%)3.715s (+3.1%)0.933s91.00x
▲ VercelNitro3.002s (+6.5% 🔺)3.732s (-2.9%)0.730s91.08x
▲ VercelNext.js (Turbopack)3.399s (+15.5% 🔺)4.296s (+9.7% 🔺)0.897s81.22x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.146s (+4.6%)3.030s (+4.3%)0.884s101.00x
💻 LocalExpress2.198s (-1.8%)3.158s (-0.7%)0.960s101.02x
💻 LocalNitro2.229s (-0.8%)3.192s (~)0.964s101.04x
🌐 StarterNext.js (Turbopack)2.461s (~)3.010s (~)0.549s101.15x
🌐 RedisNext.js (Turbopack)2.508s (+0.6%)3.026s (~)0.518s101.17x
🐘 PostgresNext.js (Turbopack)2.553s (-4.2%)3.022s (~)0.469s101.19x
🐘 PostgresExpress2.710s (-11.4% 🟢)3.026s (-18.2% 🟢)0.316s101.26x
🐘 PostgresNitro3.127s (+6.8% 🔺)3.775s (+13.7% 🔺)0.649s81.46x
🌐 TursoNext.js (Turbopack)4.645s (~)5.181s (~)0.535s62.16x
🌐 MongoDBNext.js (Turbopack)4.790s (+4.7%)5.187s (~)0.397s62.23x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.289s (-12.1% 🟢)3.715s (-14.2% 🟢)0.427s91.00x
▲ VercelNitro3.311s (-7.8% 🟢)3.960s (-6.2% 🟢)0.649s81.01x
▲ VercelExpress3.520s (+6.0% 🔺)4.386s (+11.3% 🔺)0.866s71.07x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.344s (-2.0%)2.008s (~)0.664s151.00x
🌐 RedisNext.js (Turbopack)1.379s (+1.2%)2.011s (~)0.632s151.03x
💻 LocalExpress1.412s (-1.2%)2.006s (~)0.594s151.05x
💻 LocalNext.js (Turbopack)1.418s (+3.0%)2.012s (~)0.594s151.06x
💻 LocalNitro1.424s (+0.9%)2.005s (~)0.581s151.06x
🐘 PostgresNext.js (Turbopack)1.708s (-2.8%)2.012s (~)0.304s151.27x
🐘 PostgresExpress1.910s (+0.6%)2.010s (-3.2%)0.101s151.42x
🐘 PostgresNitro1.930s (-2.4%)2.318s (+7.6% 🔺)0.388s131.44x
🌐 MongoDBNext.js (Turbopack)2.124s (~)3.016s (~)0.892s101.58x
🌐 TursoNext.js (Turbopack)2.224s (+4.7%)3.012s (~)0.788s101.66x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.724s (+0.6%)3.678s (-2.6%)0.954s91.00x
▲ VercelNext.js (Turbopack)2.792s (-0.9%)3.731s (-4.2%)0.939s91.03x
▲ VercelExpress2.845s (+8.0% 🔺)3.906s (+11.0% 🔺)1.061s81.04x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.142s (~)3.064s (+2.9%)0.923s101.00x
💻 LocalExpress2.191s (-5.9% 🟢)3.158s (-3.4%)0.967s101.02x
💻 LocalNitro2.322s (+2.7%)3.250s (+1.1%)0.928s101.08x
🌐 StarterNext.js (Turbopack)2.441s (~)3.009s (~)0.568s101.14x
🐘 PostgresNext.js (Turbopack)2.533s (+3.2%)3.032s (~)0.499s101.18x
🌐 RedisNext.js (Turbopack)2.540s (+2.6%)3.050s (+1.2%)0.510s101.19x
🐘 PostgresNitro2.634s (+2.0%)3.019s (~)0.386s101.23x
🐘 PostgresExpress2.734s (~)3.013s (~)0.278s101.28x
🌐 MongoDBNext.js (Turbopack)4.708s (-1.6%)5.184s (~)0.475s62.20x
🌐 TursoNext.js (Turbopack)4.724s (-2.3%)5.183s (-3.1%)0.459s62.21x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.956s (-8.2% 🟢)3.724s (+1.1%)0.768s91.00x
▲ VercelNitro3.087s (-3.5%)3.742s (-3.8%)0.654s91.04x
▲ VercelNext.js (Turbopack)3.104s (+0.6%)3.687s (-4.9%)0.583s91.05x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.124s (-3.3%)1.005s (~)0.000s (+100.0% 🔺)1.013s (~)0.889s101.00x
💻 LocalNext.js (Turbopack)0.144s (+2.1%)1.003s (~)0.017s (+2.4%)1.029s (~)0.885s101.16x
🌐 RedisNext.js (Turbopack)0.145s (-1.4%)1.004s (~)0.000s (NaN%)1.014s (~)0.869s101.17x
💻 LocalExpress0.171s (-3.8%)0.992s (~)0.014s (-6.5% 🟢)1.021s (~)0.850s101.38x
💻 LocalNitro0.179s (+1.5%)0.992s (~)0.014s (-1.4%)1.021s (~)0.842s101.44x
🌐 TursoNext.js (Turbopack)0.466s (-9.2% 🟢)0.985s (+5.4% 🔺)0.000s (NaN%)1.013s (~)0.548s103.75x
🌐 MongoDBNext.js (Turbopack)0.479s (-9.3% 🟢)0.970s (+5.5% 🔺)0.000s (~)1.016s (~)0.537s103.87x
🐘 PostgresNext.js (Turbopack)0.811s (-44.3% 🟢)0.847s (-49.1% 🟢)0.001s (+Infinity% 🔺)1.018s (-49.5% 🟢)0.207s106.54x
🐘 PostgresNitro2.169s (-5.3% 🟢)2.877s (+4.5%)0.000s (-33.3% 🟢)3.014s (~)0.846s1017.49x
🐘 PostgresExpress2.335s (+2.4%)2.708s (-2.0%)0.000s (+Infinity% 🔺)3.016s (~)0.680s1018.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.668s (+4.7%)3.144s (+2.4%)0.363s (-21.2% 🟢)3.992s (+1.1%)1.324s101.00x
▲ VercelNext.js (Turbopack)2.778s (+7.2% 🔺)3.294s (+2.8%)0.368s (-72.5% 🟢)4.096s (-18.1% 🟢)1.317s101.04x
▲ VercelNitro2.854s (+5.2% 🔺)3.241s (+1.7%)0.384s (+11.3% 🔺)4.065s (+1.9%)1.211s101.07x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)6/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelExpress4/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

@github-actions

github-actionsBot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production278811297
✅ 💻 Local Development23508243
✅ 📦 Local Production26208270
✅ 🐘 Local Postgres26208270
❌ 🪟 Windows027027
❌ 🌍 Community Worlds81390120
Total111874351227

❌ Failed Tests

▲ Vercel Production (8 failed)

hono (8 failed):

  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter
🪟 Windows (27 failed)

nextjs-turbopack (27 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • webhook route with invalid token
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • retryAttemptCounterWorkflow
  • retryableAndFatalErrorWorkflow
  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter
🌍 Community Worlds (39 failed)

mongodb-dev (3 failed):

  • dev e2e should rebuild on step change
  • dev e2e should rebuild on workflow change
  • dev e2e should rebuild on adding workflow file

mongodb (27 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • webhook route with invalid token
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • retryAttemptCounterWorkflow
  • retryableAndFatalErrorWorkflow
  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter

starter (8 failed):

  • addTenWorkflow
  • addTenWorkflow
  • retryAttemptCounterWorkflow
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

turso (1 failed):

  • webhookWorkflow

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro2601
✅ example2601
✅ express2601
✅ fastify2601
❌ hono1881
✅ nextjs-turbopack2601
✅ nextjs-webpack2601
✅ nitro2601
✅ nuxt2601
✅ sveltekit2601
✅ vite2601
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
❌ 🪟 Windows
AppPassedFailedSkipped
❌ nextjs-turbopack0270
❌ 🌍 Community Worlds
AppPassedFailedSkipped
❌ mongodb-dev030
❌ mongodb0270
✅ redis-dev300
✅ redis2700
✅ starter-dev300
❌ starter1980
✅ turso-dev300
❌ turso2610

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@VaguelySerious

VaguelySerious commented Dec 28, 2025

Copy link
Copy Markdown
Member

I'm taking over responsibility for merging this code as if I wrote it (saying this to indicate that my DCO rights should apply to this code), so I can get this merged

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@VaguelySerious

Copy link
Copy Markdown
Member

Shipped in @workflow/ai@4.0.1-beta.38

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

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

Fix: Handle object-style finishReason for AI SDK v5/v6 compatibility - #695

Merged
VaguelySerious merged 10 commits into
mainfrom
ctate/fix-durable-agent-finish-reason
Dec 28, 2025
Merged

Fix: Handle object-style finishReason for AI SDK v5/v6 compatibility#695
VaguelySerious merged 10 commits into
mainfrom
ctate/fix-durable-agent-finish-reason

Conversation

@ctate

Copy link
Copy Markdown
Contributor

Users were encountering the following error when using DurableAgent with AI SDK v6:

Error: Unexpected finish reason: [object Object]
at streamTextIterator (stream-text-iterator.ts:327:12)

This occurred because AI SDK v6 (or certain providers) may return finishReason as an object with a type property (e.g., { type: 'stop' }) rather than a plain string like 'stop' as in AI SDK v5.

Solution

  • Added normalization logic in stream-text-iterator.ts and do-stream-step.ts to handle both formats
  • Uses the AI SDK's FinishReason type directly from the ai package, ensuring 1:1 type compatibility with whichever version the consuming app uses (v5 or v6)
  • Improved error messaging to show the actual object value via JSON.stringify when an unexpected finish reason is encountered

@vercel

vercelBot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Dec 28, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 270e3ef

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

@github-actions

github-actionsBot commented Dec 28, 2025

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
🌐 Starter🥇 Next.js (Turbopack)0.039s (+7.2% 🔺)1.014s (~)0.975s101.00x
🌐 RedisNext.js (Turbopack)0.040s (-0.7%)1.017s (~)0.977s101.04x
💻 LocalNitro0.043s (~)1.006s (~)0.963s101.12x
💻 LocalExpress0.043s (~)1.007s (~)0.964s101.12x
💻 LocalNext.js (Turbopack)0.044s (+16.2% 🔺)1.019s (~)0.975s101.13x
🌐 TursoNext.js (Turbopack)0.098s (+22.3% 🔺)1.015s (~)0.917s102.54x
🌐 MongoDBNext.js (Turbopack)0.120s (+133.0% 🔺)1.016s (~)0.896s103.11x
🐘 PostgresNitro0.198s (-33.6% 🟢)1.024s (+1.2%)0.826s105.14x
🐘 PostgresExpress0.363s (+23.8% 🔺)1.014s (-0.5%)0.651s109.40x
🐘 PostgresNext.js (Turbopack)0.372s (+4.8%)1.022s (~)0.650s109.64x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.584s (-0.6%)1.530s (+2.8%)0.947s101.00x
▲ VercelNext.js (Turbopack)0.614s (+14.9% 🔺)1.605s (-0.6%)0.991s101.05x
▲ VercelExpress0.632s (+28.0% 🔺)1.753s (+27.6% 🔺)1.122s101.08x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.092s (+1.1%)2.009s (~)0.918s101.00x
💻 LocalNext.js (Turbopack)1.100s (+0.6%)2.011s (~)0.911s101.01x
🌐 RedisNext.js (Turbopack)1.101s (~)2.013s (~)0.912s101.01x
💻 LocalExpress1.112s (~)2.007s (~)0.895s101.02x
💻 LocalNitro1.114s (~)2.006s (~)0.892s101.02x
🌐 MongoDBNext.js (Turbopack)1.278s (-1.2%)2.015s (~)0.736s101.17x
🌐 TursoNext.js (Turbopack)1.284s (~)2.012s (~)0.728s101.18x
🐘 PostgresNext.js (Turbopack)1.598s (-31.5% 🟢)2.015s (-33.2% 🟢)0.417s101.46x
🐘 PostgresExpress2.211s (+2.5%)3.015s (~)0.804s102.03x
🐘 PostgresNitro2.365s (+9.7% 🔺)3.013s (~)0.648s102.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.648s (-1.0%)3.697s (~)1.049s101.00x
▲ VercelExpress2.745s (+1.6%)3.734s (+3.7%)0.989s101.04x
▲ VercelNitro2.779s (+11.6% 🔺)3.625s (~)0.846s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.612s (~)11.011s (~)0.399s51.00x
🌐 RedisNext.js (Turbopack)10.693s (~)11.021s (~)0.328s51.01x
💻 LocalNext.js (Turbopack)10.698s (+0.6%)11.022s (~)0.324s51.01x
💻 LocalExpress10.781s (~)11.011s (~)0.231s51.02x
💻 LocalNitro10.793s (~)11.012s (~)0.219s51.02x
🌐 MongoDBNext.js (Turbopack)12.126s (-0.5%)12.630s (-3.0%)0.505s51.14x
🌐 TursoNext.js (Turbopack)12.189s (~)13.023s (~)0.834s51.15x
🐘 PostgresNext.js (Turbopack)14.249s (-18.9% 🟢)15.040s (-17.5% 🟢)0.790s51.34x
🐘 PostgresExpress20.337s (-0.6%)21.036s (~)0.699s51.92x
🐘 PostgresNitro20.372s (-0.5%)21.037s (~)0.664s51.92x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.491s (+1.1%)22.413s (+2.0%)0.921s51.00x
▲ VercelNitro21.547s (+1.5%)22.424s (+1.9%)0.877s51.00x
▲ VercelNext.js (Turbopack)21.792s (+1.2%)22.753s (+1.1%)0.961s51.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.350s (+0.9%)2.007s (~)0.657s151.00x
🌐 RedisNext.js (Turbopack)1.371s (~)2.011s (~)0.640s151.02x
💻 LocalNext.js (Turbopack)1.398s (~)2.012s (~)0.614s151.04x
💻 LocalExpress1.399s (-1.0%)2.005s (~)0.606s151.04x
💻 LocalNitro1.412s (~)2.006s (~)0.594s151.05x
🐘 PostgresNext.js (Turbopack)1.820s (-7.2% 🟢)2.015s (-3.1%)0.194s151.35x
🌐 MongoDBNext.js (Turbopack)2.131s (-1.4%)3.017s (~)0.887s101.58x
🌐 TursoNext.js (Turbopack)2.227s (+5.0%)3.013s (~)0.786s101.65x
🐘 PostgresExpress2.380s (~)3.014s (~)0.633s101.76x
🐘 PostgresNitro2.582s (+8.7% 🔺)3.015s (~)0.433s101.91x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.782s (+3.5%)3.715s (+3.1%)0.933s91.00x
▲ VercelNitro3.002s (+6.5% 🔺)3.732s (-2.9%)0.730s91.08x
▲ VercelNext.js (Turbopack)3.399s (+15.5% 🔺)4.296s (+9.7% 🔺)0.897s81.22x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.146s (+4.6%)3.030s (+4.3%)0.884s101.00x
💻 LocalExpress2.198s (-1.8%)3.158s (-0.7%)0.960s101.02x
💻 LocalNitro2.229s (-0.8%)3.192s (~)0.964s101.04x
🌐 StarterNext.js (Turbopack)2.461s (~)3.010s (~)0.549s101.15x
🌐 RedisNext.js (Turbopack)2.508s (+0.6%)3.026s (~)0.518s101.17x
🐘 PostgresNext.js (Turbopack)2.553s (-4.2%)3.022s (~)0.469s101.19x
🐘 PostgresExpress2.710s (-11.4% 🟢)3.026s (-18.2% 🟢)0.316s101.26x
🐘 PostgresNitro3.127s (+6.8% 🔺)3.775s (+13.7% 🔺)0.649s81.46x
🌐 TursoNext.js (Turbopack)4.645s (~)5.181s (~)0.535s62.16x
🌐 MongoDBNext.js (Turbopack)4.790s (+4.7%)5.187s (~)0.397s62.23x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.289s (-12.1% 🟢)3.715s (-14.2% 🟢)0.427s91.00x
▲ VercelNitro3.311s (-7.8% 🟢)3.960s (-6.2% 🟢)0.649s81.01x
▲ VercelExpress3.520s (+6.0% 🔺)4.386s (+11.3% 🔺)0.866s71.07x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.344s (-2.0%)2.008s (~)0.664s151.00x
🌐 RedisNext.js (Turbopack)1.379s (+1.2%)2.011s (~)0.632s151.03x
💻 LocalExpress1.412s (-1.2%)2.006s (~)0.594s151.05x
💻 LocalNext.js (Turbopack)1.418s (+3.0%)2.012s (~)0.594s151.06x
💻 LocalNitro1.424s (+0.9%)2.005s (~)0.581s151.06x
🐘 PostgresNext.js (Turbopack)1.708s (-2.8%)2.012s (~)0.304s151.27x
🐘 PostgresExpress1.910s (+0.6%)2.010s (-3.2%)0.101s151.42x
🐘 PostgresNitro1.930s (-2.4%)2.318s (+7.6% 🔺)0.388s131.44x
🌐 MongoDBNext.js (Turbopack)2.124s (~)3.016s (~)0.892s101.58x
🌐 TursoNext.js (Turbopack)2.224s (+4.7%)3.012s (~)0.788s101.66x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.724s (+0.6%)3.678s (-2.6%)0.954s91.00x
▲ VercelNext.js (Turbopack)2.792s (-0.9%)3.731s (-4.2%)0.939s91.03x
▲ VercelExpress2.845s (+8.0% 🔺)3.906s (+11.0% 🔺)1.061s81.04x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.142s (~)3.064s (+2.9%)0.923s101.00x
💻 LocalExpress2.191s (-5.9% 🟢)3.158s (-3.4%)0.967s101.02x
💻 LocalNitro2.322s (+2.7%)3.250s (+1.1%)0.928s101.08x
🌐 StarterNext.js (Turbopack)2.441s (~)3.009s (~)0.568s101.14x
🐘 PostgresNext.js (Turbopack)2.533s (+3.2%)3.032s (~)0.499s101.18x
🌐 RedisNext.js (Turbopack)2.540s (+2.6%)3.050s (+1.2%)0.510s101.19x
🐘 PostgresNitro2.634s (+2.0%)3.019s (~)0.386s101.23x
🐘 PostgresExpress2.734s (~)3.013s (~)0.278s101.28x
🌐 MongoDBNext.js (Turbopack)4.708s (-1.6%)5.184s (~)0.475s62.20x
🌐 TursoNext.js (Turbopack)4.724s (-2.3%)5.183s (-3.1%)0.459s62.21x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.956s (-8.2% 🟢)3.724s (+1.1%)0.768s91.00x
▲ VercelNitro3.087s (-3.5%)3.742s (-3.8%)0.654s91.04x
▲ VercelNext.js (Turbopack)3.104s (+0.6%)3.687s (-4.9%)0.583s91.05x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.124s (-3.3%)1.005s (~)0.000s (+100.0% 🔺)1.013s (~)0.889s101.00x
💻 LocalNext.js (Turbopack)0.144s (+2.1%)1.003s (~)0.017s (+2.4%)1.029s (~)0.885s101.16x
🌐 RedisNext.js (Turbopack)0.145s (-1.4%)1.004s (~)0.000s (NaN%)1.014s (~)0.869s101.17x
💻 LocalExpress0.171s (-3.8%)0.992s (~)0.014s (-6.5% 🟢)1.021s (~)0.850s101.38x
💻 LocalNitro0.179s (+1.5%)0.992s (~)0.014s (-1.4%)1.021s (~)0.842s101.44x
🌐 TursoNext.js (Turbopack)0.466s (-9.2% 🟢)0.985s (+5.4% 🔺)0.000s (NaN%)1.013s (~)0.548s103.75x
🌐 MongoDBNext.js (Turbopack)0.479s (-9.3% 🟢)0.970s (+5.5% 🔺)0.000s (~)1.016s (~)0.537s103.87x
🐘 PostgresNext.js (Turbopack)0.811s (-44.3% 🟢)0.847s (-49.1% 🟢)0.001s (+Infinity% 🔺)1.018s (-49.5% 🟢)0.207s106.54x
🐘 PostgresNitro2.169s (-5.3% 🟢)2.877s (+4.5%)0.000s (-33.3% 🟢)3.014s (~)0.846s1017.49x
🐘 PostgresExpress2.335s (+2.4%)2.708s (-2.0%)0.000s (+Infinity% 🔺)3.016s (~)0.680s1018.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.668s (+4.7%)3.144s (+2.4%)0.363s (-21.2% 🟢)3.992s (+1.1%)1.324s101.00x
▲ VercelNext.js (Turbopack)2.778s (+7.2% 🔺)3.294s (+2.8%)0.368s (-72.5% 🟢)4.096s (-18.1% 🟢)1.317s101.04x
▲ VercelNitro2.854s (+5.2% 🔺)3.241s (+1.7%)0.384s (+11.3% 🔺)4.065s (+1.9%)1.211s101.07x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)6/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelExpress4/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

@github-actions

github-actionsBot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production278811297
✅ 💻 Local Development23508243
✅ 📦 Local Production26208270
✅ 🐘 Local Postgres26208270
❌ 🪟 Windows027027
❌ 🌍 Community Worlds81390120
Total111874351227

❌ Failed Tests

▲ Vercel Production (8 failed)

hono (8 failed):

  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter
🪟 Windows (27 failed)

nextjs-turbopack (27 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • webhook route with invalid token
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • retryAttemptCounterWorkflow
  • retryableAndFatalErrorWorkflow
  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter
🌍 Community Worlds (39 failed)

mongodb-dev (3 failed):

  • dev e2e should rebuild on step change
  • dev e2e should rebuild on workflow change
  • dev e2e should rebuild on adding workflow file

mongodb (27 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • webhook route with invalid token
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • retryAttemptCounterWorkflow
  • retryableAndFatalErrorWorkflow
  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter

starter (8 failed):

  • addTenWorkflow
  • addTenWorkflow
  • retryAttemptCounterWorkflow
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

turso (1 failed):

  • webhookWorkflow

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro2601
✅ example2601
✅ express2601
✅ fastify2601
❌ hono1881
✅ nextjs-turbopack2601
✅ nextjs-webpack2601
✅ nitro2601
✅ nuxt2601
✅ sveltekit2601
✅ vite2601
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
❌ 🪟 Windows
AppPassedFailedSkipped
❌ nextjs-turbopack0270
❌ 🌍 Community Worlds
AppPassedFailedSkipped
❌ mongodb-dev030
❌ mongodb0270
✅ redis-dev300
✅ redis2700
✅ starter-dev300
❌ starter1980
✅ turso-dev300
❌ turso2610

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@VaguelySerious

VaguelySerious commented Dec 28, 2025

Copy link
Copy Markdown
Member

I'm taking over responsibility for merging this code as if I wrote it (saying this to indicate that my DCO rights should apply to this code), so I can get this merged

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@VaguelySerious

Copy link
Copy Markdown
Member

Shipped in @workflow/ai@4.0.1-beta.38

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

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

Fix: Handle object-style finishReason for AI SDK v5/v6 compatibility - #695

Merged
VaguelySerious merged 10 commits into
mainfrom
ctate/fix-durable-agent-finish-reason
Dec 28, 2025
Merged

Fix: Handle object-style finishReason for AI SDK v5/v6 compatibility#695
VaguelySerious merged 10 commits into
mainfrom
ctate/fix-durable-agent-finish-reason

Conversation

@ctate

Copy link
Copy Markdown
Contributor

Users were encountering the following error when using DurableAgent with AI SDK v6:

Error: Unexpected finish reason: [object Object]
at streamTextIterator (stream-text-iterator.ts:327:12)

This occurred because AI SDK v6 (or certain providers) may return finishReason as an object with a type property (e.g., { type: 'stop' }) rather than a plain string like 'stop' as in AI SDK v5.

Solution

  • Added normalization logic in stream-text-iterator.ts and do-stream-step.ts to handle both formats
  • Uses the AI SDK's FinishReason type directly from the ai package, ensuring 1:1 type compatibility with whichever version the consuming app uses (v5 or v6)
  • Improved error messaging to show the actual object value via JSON.stringify when an unexpected finish reason is encountered

@vercel

vercelBot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Dec 28, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 270e3ef

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

@github-actions

github-actionsBot commented Dec 28, 2025

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
🌐 Starter🥇 Next.js (Turbopack)0.039s (+7.2% 🔺)1.014s (~)0.975s101.00x
🌐 RedisNext.js (Turbopack)0.040s (-0.7%)1.017s (~)0.977s101.04x
💻 LocalNitro0.043s (~)1.006s (~)0.963s101.12x
💻 LocalExpress0.043s (~)1.007s (~)0.964s101.12x
💻 LocalNext.js (Turbopack)0.044s (+16.2% 🔺)1.019s (~)0.975s101.13x
🌐 TursoNext.js (Turbopack)0.098s (+22.3% 🔺)1.015s (~)0.917s102.54x
🌐 MongoDBNext.js (Turbopack)0.120s (+133.0% 🔺)1.016s (~)0.896s103.11x
🐘 PostgresNitro0.198s (-33.6% 🟢)1.024s (+1.2%)0.826s105.14x
🐘 PostgresExpress0.363s (+23.8% 🔺)1.014s (-0.5%)0.651s109.40x
🐘 PostgresNext.js (Turbopack)0.372s (+4.8%)1.022s (~)0.650s109.64x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.584s (-0.6%)1.530s (+2.8%)0.947s101.00x
▲ VercelNext.js (Turbopack)0.614s (+14.9% 🔺)1.605s (-0.6%)0.991s101.05x
▲ VercelExpress0.632s (+28.0% 🔺)1.753s (+27.6% 🔺)1.122s101.08x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.092s (+1.1%)2.009s (~)0.918s101.00x
💻 LocalNext.js (Turbopack)1.100s (+0.6%)2.011s (~)0.911s101.01x
🌐 RedisNext.js (Turbopack)1.101s (~)2.013s (~)0.912s101.01x
💻 LocalExpress1.112s (~)2.007s (~)0.895s101.02x
💻 LocalNitro1.114s (~)2.006s (~)0.892s101.02x
🌐 MongoDBNext.js (Turbopack)1.278s (-1.2%)2.015s (~)0.736s101.17x
🌐 TursoNext.js (Turbopack)1.284s (~)2.012s (~)0.728s101.18x
🐘 PostgresNext.js (Turbopack)1.598s (-31.5% 🟢)2.015s (-33.2% 🟢)0.417s101.46x
🐘 PostgresExpress2.211s (+2.5%)3.015s (~)0.804s102.03x
🐘 PostgresNitro2.365s (+9.7% 🔺)3.013s (~)0.648s102.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.648s (-1.0%)3.697s (~)1.049s101.00x
▲ VercelExpress2.745s (+1.6%)3.734s (+3.7%)0.989s101.04x
▲ VercelNitro2.779s (+11.6% 🔺)3.625s (~)0.846s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.612s (~)11.011s (~)0.399s51.00x
🌐 RedisNext.js (Turbopack)10.693s (~)11.021s (~)0.328s51.01x
💻 LocalNext.js (Turbopack)10.698s (+0.6%)11.022s (~)0.324s51.01x
💻 LocalExpress10.781s (~)11.011s (~)0.231s51.02x
💻 LocalNitro10.793s (~)11.012s (~)0.219s51.02x
🌐 MongoDBNext.js (Turbopack)12.126s (-0.5%)12.630s (-3.0%)0.505s51.14x
🌐 TursoNext.js (Turbopack)12.189s (~)13.023s (~)0.834s51.15x
🐘 PostgresNext.js (Turbopack)14.249s (-18.9% 🟢)15.040s (-17.5% 🟢)0.790s51.34x
🐘 PostgresExpress20.337s (-0.6%)21.036s (~)0.699s51.92x
🐘 PostgresNitro20.372s (-0.5%)21.037s (~)0.664s51.92x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.491s (+1.1%)22.413s (+2.0%)0.921s51.00x
▲ VercelNitro21.547s (+1.5%)22.424s (+1.9%)0.877s51.00x
▲ VercelNext.js (Turbopack)21.792s (+1.2%)22.753s (+1.1%)0.961s51.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.350s (+0.9%)2.007s (~)0.657s151.00x
🌐 RedisNext.js (Turbopack)1.371s (~)2.011s (~)0.640s151.02x
💻 LocalNext.js (Turbopack)1.398s (~)2.012s (~)0.614s151.04x
💻 LocalExpress1.399s (-1.0%)2.005s (~)0.606s151.04x
💻 LocalNitro1.412s (~)2.006s (~)0.594s151.05x
🐘 PostgresNext.js (Turbopack)1.820s (-7.2% 🟢)2.015s (-3.1%)0.194s151.35x
🌐 MongoDBNext.js (Turbopack)2.131s (-1.4%)3.017s (~)0.887s101.58x
🌐 TursoNext.js (Turbopack)2.227s (+5.0%)3.013s (~)0.786s101.65x
🐘 PostgresExpress2.380s (~)3.014s (~)0.633s101.76x
🐘 PostgresNitro2.582s (+8.7% 🔺)3.015s (~)0.433s101.91x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.782s (+3.5%)3.715s (+3.1%)0.933s91.00x
▲ VercelNitro3.002s (+6.5% 🔺)3.732s (-2.9%)0.730s91.08x
▲ VercelNext.js (Turbopack)3.399s (+15.5% 🔺)4.296s (+9.7% 🔺)0.897s81.22x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.146s (+4.6%)3.030s (+4.3%)0.884s101.00x
💻 LocalExpress2.198s (-1.8%)3.158s (-0.7%)0.960s101.02x
💻 LocalNitro2.229s (-0.8%)3.192s (~)0.964s101.04x
🌐 StarterNext.js (Turbopack)2.461s (~)3.010s (~)0.549s101.15x
🌐 RedisNext.js (Turbopack)2.508s (+0.6%)3.026s (~)0.518s101.17x
🐘 PostgresNext.js (Turbopack)2.553s (-4.2%)3.022s (~)0.469s101.19x
🐘 PostgresExpress2.710s (-11.4% 🟢)3.026s (-18.2% 🟢)0.316s101.26x
🐘 PostgresNitro3.127s (+6.8% 🔺)3.775s (+13.7% 🔺)0.649s81.46x
🌐 TursoNext.js (Turbopack)4.645s (~)5.181s (~)0.535s62.16x
🌐 MongoDBNext.js (Turbopack)4.790s (+4.7%)5.187s (~)0.397s62.23x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.289s (-12.1% 🟢)3.715s (-14.2% 🟢)0.427s91.00x
▲ VercelNitro3.311s (-7.8% 🟢)3.960s (-6.2% 🟢)0.649s81.01x
▲ VercelExpress3.520s (+6.0% 🔺)4.386s (+11.3% 🔺)0.866s71.07x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.344s (-2.0%)2.008s (~)0.664s151.00x
🌐 RedisNext.js (Turbopack)1.379s (+1.2%)2.011s (~)0.632s151.03x
💻 LocalExpress1.412s (-1.2%)2.006s (~)0.594s151.05x
💻 LocalNext.js (Turbopack)1.418s (+3.0%)2.012s (~)0.594s151.06x
💻 LocalNitro1.424s (+0.9%)2.005s (~)0.581s151.06x
🐘 PostgresNext.js (Turbopack)1.708s (-2.8%)2.012s (~)0.304s151.27x
🐘 PostgresExpress1.910s (+0.6%)2.010s (-3.2%)0.101s151.42x
🐘 PostgresNitro1.930s (-2.4%)2.318s (+7.6% 🔺)0.388s131.44x
🌐 MongoDBNext.js (Turbopack)2.124s (~)3.016s (~)0.892s101.58x
🌐 TursoNext.js (Turbopack)2.224s (+4.7%)3.012s (~)0.788s101.66x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.724s (+0.6%)3.678s (-2.6%)0.954s91.00x
▲ VercelNext.js (Turbopack)2.792s (-0.9%)3.731s (-4.2%)0.939s91.03x
▲ VercelExpress2.845s (+8.0% 🔺)3.906s (+11.0% 🔺)1.061s81.04x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.142s (~)3.064s (+2.9%)0.923s101.00x
💻 LocalExpress2.191s (-5.9% 🟢)3.158s (-3.4%)0.967s101.02x
💻 LocalNitro2.322s (+2.7%)3.250s (+1.1%)0.928s101.08x
🌐 StarterNext.js (Turbopack)2.441s (~)3.009s (~)0.568s101.14x
🐘 PostgresNext.js (Turbopack)2.533s (+3.2%)3.032s (~)0.499s101.18x
🌐 RedisNext.js (Turbopack)2.540s (+2.6%)3.050s (+1.2%)0.510s101.19x
🐘 PostgresNitro2.634s (+2.0%)3.019s (~)0.386s101.23x
🐘 PostgresExpress2.734s (~)3.013s (~)0.278s101.28x
🌐 MongoDBNext.js (Turbopack)4.708s (-1.6%)5.184s (~)0.475s62.20x
🌐 TursoNext.js (Turbopack)4.724s (-2.3%)5.183s (-3.1%)0.459s62.21x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.956s (-8.2% 🟢)3.724s (+1.1%)0.768s91.00x
▲ VercelNitro3.087s (-3.5%)3.742s (-3.8%)0.654s91.04x
▲ VercelNext.js (Turbopack)3.104s (+0.6%)3.687s (-4.9%)0.583s91.05x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.124s (-3.3%)1.005s (~)0.000s (+100.0% 🔺)1.013s (~)0.889s101.00x
💻 LocalNext.js (Turbopack)0.144s (+2.1%)1.003s (~)0.017s (+2.4%)1.029s (~)0.885s101.16x
🌐 RedisNext.js (Turbopack)0.145s (-1.4%)1.004s (~)0.000s (NaN%)1.014s (~)0.869s101.17x
💻 LocalExpress0.171s (-3.8%)0.992s (~)0.014s (-6.5% 🟢)1.021s (~)0.850s101.38x
💻 LocalNitro0.179s (+1.5%)0.992s (~)0.014s (-1.4%)1.021s (~)0.842s101.44x
🌐 TursoNext.js (Turbopack)0.466s (-9.2% 🟢)0.985s (+5.4% 🔺)0.000s (NaN%)1.013s (~)0.548s103.75x
🌐 MongoDBNext.js (Turbopack)0.479s (-9.3% 🟢)0.970s (+5.5% 🔺)0.000s (~)1.016s (~)0.537s103.87x
🐘 PostgresNext.js (Turbopack)0.811s (-44.3% 🟢)0.847s (-49.1% 🟢)0.001s (+Infinity% 🔺)1.018s (-49.5% 🟢)0.207s106.54x
🐘 PostgresNitro2.169s (-5.3% 🟢)2.877s (+4.5%)0.000s (-33.3% 🟢)3.014s (~)0.846s1017.49x
🐘 PostgresExpress2.335s (+2.4%)2.708s (-2.0%)0.000s (+Infinity% 🔺)3.016s (~)0.680s1018.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.668s (+4.7%)3.144s (+2.4%)0.363s (-21.2% 🟢)3.992s (+1.1%)1.324s101.00x
▲ VercelNext.js (Turbopack)2.778s (+7.2% 🔺)3.294s (+2.8%)0.368s (-72.5% 🟢)4.096s (-18.1% 🟢)1.317s101.04x
▲ VercelNitro2.854s (+5.2% 🔺)3.241s (+1.7%)0.384s (+11.3% 🔺)4.065s (+1.9%)1.211s101.07x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)6/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelExpress4/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

@github-actions

github-actionsBot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production278811297
✅ 💻 Local Development23508243
✅ 📦 Local Production26208270
✅ 🐘 Local Postgres26208270
❌ 🪟 Windows027027
❌ 🌍 Community Worlds81390120
Total111874351227

❌ Failed Tests

▲ Vercel Production (8 failed)

hono (8 failed):

  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter
🪟 Windows (27 failed)

nextjs-turbopack (27 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • webhook route with invalid token
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • retryAttemptCounterWorkflow
  • retryableAndFatalErrorWorkflow
  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter
🌍 Community Worlds (39 failed)

mongodb-dev (3 failed):

  • dev e2e should rebuild on step change
  • dev e2e should rebuild on workflow change
  • dev e2e should rebuild on adding workflow file

mongodb (27 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • webhook route with invalid token
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • retryAttemptCounterWorkflow
  • retryableAndFatalErrorWorkflow
  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter

starter (8 failed):

  • addTenWorkflow
  • addTenWorkflow
  • retryAttemptCounterWorkflow
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

turso (1 failed):

  • webhookWorkflow

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro2601
✅ example2601
✅ express2601
✅ fastify2601
❌ hono1881
✅ nextjs-turbopack2601
✅ nextjs-webpack2601
✅ nitro2601
✅ nuxt2601
✅ sveltekit2601
✅ vite2601
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
❌ 🪟 Windows
AppPassedFailedSkipped
❌ nextjs-turbopack0270
❌ 🌍 Community Worlds
AppPassedFailedSkipped
❌ mongodb-dev030
❌ mongodb0270
✅ redis-dev300
✅ redis2700
✅ starter-dev300
❌ starter1980
✅ turso-dev300
❌ turso2610

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@VaguelySerious

VaguelySerious commented Dec 28, 2025

Copy link
Copy Markdown
Member

I'm taking over responsibility for merging this code as if I wrote it (saying this to indicate that my DCO rights should apply to this code), so I can get this merged

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@VaguelySerious

Copy link
Copy Markdown
Member

Shipped in @workflow/ai@4.0.1-beta.38

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

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

Fix: Handle object-style finishReason for AI SDK v5/v6 compatibility - #695

Merged
VaguelySerious merged 10 commits into
mainfrom
ctate/fix-durable-agent-finish-reason
Dec 28, 2025
Merged

Fix: Handle object-style finishReason for AI SDK v5/v6 compatibility#695
VaguelySerious merged 10 commits into
mainfrom
ctate/fix-durable-agent-finish-reason

Conversation

@ctate

Copy link
Copy Markdown
Contributor

Users were encountering the following error when using DurableAgent with AI SDK v6:

Error: Unexpected finish reason: [object Object]
at streamTextIterator (stream-text-iterator.ts:327:12)

This occurred because AI SDK v6 (or certain providers) may return finishReason as an object with a type property (e.g., { type: 'stop' }) rather than a plain string like 'stop' as in AI SDK v5.

Solution

  • Added normalization logic in stream-text-iterator.ts and do-stream-step.ts to handle both formats
  • Uses the AI SDK's FinishReason type directly from the ai package, ensuring 1:1 type compatibility with whichever version the consuming app uses (v5 or v6)
  • Improved error messaging to show the actual object value via JSON.stringify when an unexpected finish reason is encountered

@vercel

vercelBot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Dec 28, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 270e3ef

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

@github-actions

github-actionsBot commented Dec 28, 2025

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
🌐 Starter🥇 Next.js (Turbopack)0.039s (+7.2% 🔺)1.014s (~)0.975s101.00x
🌐 RedisNext.js (Turbopack)0.040s (-0.7%)1.017s (~)0.977s101.04x
💻 LocalNitro0.043s (~)1.006s (~)0.963s101.12x
💻 LocalExpress0.043s (~)1.007s (~)0.964s101.12x
💻 LocalNext.js (Turbopack)0.044s (+16.2% 🔺)1.019s (~)0.975s101.13x
🌐 TursoNext.js (Turbopack)0.098s (+22.3% 🔺)1.015s (~)0.917s102.54x
🌐 MongoDBNext.js (Turbopack)0.120s (+133.0% 🔺)1.016s (~)0.896s103.11x
🐘 PostgresNitro0.198s (-33.6% 🟢)1.024s (+1.2%)0.826s105.14x
🐘 PostgresExpress0.363s (+23.8% 🔺)1.014s (-0.5%)0.651s109.40x
🐘 PostgresNext.js (Turbopack)0.372s (+4.8%)1.022s (~)0.650s109.64x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro0.584s (-0.6%)1.530s (+2.8%)0.947s101.00x
▲ VercelNext.js (Turbopack)0.614s (+14.9% 🔺)1.605s (-0.6%)0.991s101.05x
▲ VercelExpress0.632s (+28.0% 🔺)1.753s (+27.6% 🔺)1.122s101.08x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.092s (+1.1%)2.009s (~)0.918s101.00x
💻 LocalNext.js (Turbopack)1.100s (+0.6%)2.011s (~)0.911s101.01x
🌐 RedisNext.js (Turbopack)1.101s (~)2.013s (~)0.912s101.01x
💻 LocalExpress1.112s (~)2.007s (~)0.895s101.02x
💻 LocalNitro1.114s (~)2.006s (~)0.892s101.02x
🌐 MongoDBNext.js (Turbopack)1.278s (-1.2%)2.015s (~)0.736s101.17x
🌐 TursoNext.js (Turbopack)1.284s (~)2.012s (~)0.728s101.18x
🐘 PostgresNext.js (Turbopack)1.598s (-31.5% 🟢)2.015s (-33.2% 🟢)0.417s101.46x
🐘 PostgresExpress2.211s (+2.5%)3.015s (~)0.804s102.03x
🐘 PostgresNitro2.365s (+9.7% 🔺)3.013s (~)0.648s102.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.648s (-1.0%)3.697s (~)1.049s101.00x
▲ VercelExpress2.745s (+1.6%)3.734s (+3.7%)0.989s101.04x
▲ VercelNitro2.779s (+11.6% 🔺)3.625s (~)0.846s101.05x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)10.612s (~)11.011s (~)0.399s51.00x
🌐 RedisNext.js (Turbopack)10.693s (~)11.021s (~)0.328s51.01x
💻 LocalNext.js (Turbopack)10.698s (+0.6%)11.022s (~)0.324s51.01x
💻 LocalExpress10.781s (~)11.011s (~)0.231s51.02x
💻 LocalNitro10.793s (~)11.012s (~)0.219s51.02x
🌐 MongoDBNext.js (Turbopack)12.126s (-0.5%)12.630s (-3.0%)0.505s51.14x
🌐 TursoNext.js (Turbopack)12.189s (~)13.023s (~)0.834s51.15x
🐘 PostgresNext.js (Turbopack)14.249s (-18.9% 🟢)15.040s (-17.5% 🟢)0.790s51.34x
🐘 PostgresExpress20.337s (-0.6%)21.036s (~)0.699s51.92x
🐘 PostgresNitro20.372s (-0.5%)21.037s (~)0.664s51.92x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.491s (+1.1%)22.413s (+2.0%)0.921s51.00x
▲ VercelNitro21.547s (+1.5%)22.424s (+1.9%)0.877s51.00x
▲ VercelNext.js (Turbopack)21.792s (+1.2%)22.753s (+1.1%)0.961s51.01x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.350s (+0.9%)2.007s (~)0.657s151.00x
🌐 RedisNext.js (Turbopack)1.371s (~)2.011s (~)0.640s151.02x
💻 LocalNext.js (Turbopack)1.398s (~)2.012s (~)0.614s151.04x
💻 LocalExpress1.399s (-1.0%)2.005s (~)0.606s151.04x
💻 LocalNitro1.412s (~)2.006s (~)0.594s151.05x
🐘 PostgresNext.js (Turbopack)1.820s (-7.2% 🟢)2.015s (-3.1%)0.194s151.35x
🌐 MongoDBNext.js (Turbopack)2.131s (-1.4%)3.017s (~)0.887s101.58x
🌐 TursoNext.js (Turbopack)2.227s (+5.0%)3.013s (~)0.786s101.65x
🐘 PostgresExpress2.380s (~)3.014s (~)0.633s101.76x
🐘 PostgresNitro2.582s (+8.7% 🔺)3.015s (~)0.433s101.91x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.782s (+3.5%)3.715s (+3.1%)0.933s91.00x
▲ VercelNitro3.002s (+6.5% 🔺)3.732s (-2.9%)0.730s91.08x
▲ VercelNext.js (Turbopack)3.399s (+15.5% 🔺)4.296s (+9.7% 🔺)0.897s81.22x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.146s (+4.6%)3.030s (+4.3%)0.884s101.00x
💻 LocalExpress2.198s (-1.8%)3.158s (-0.7%)0.960s101.02x
💻 LocalNitro2.229s (-0.8%)3.192s (~)0.964s101.04x
🌐 StarterNext.js (Turbopack)2.461s (~)3.010s (~)0.549s101.15x
🌐 RedisNext.js (Turbopack)2.508s (+0.6%)3.026s (~)0.518s101.17x
🐘 PostgresNext.js (Turbopack)2.553s (-4.2%)3.022s (~)0.469s101.19x
🐘 PostgresExpress2.710s (-11.4% 🟢)3.026s (-18.2% 🟢)0.316s101.26x
🐘 PostgresNitro3.127s (+6.8% 🔺)3.775s (+13.7% 🔺)0.649s81.46x
🌐 TursoNext.js (Turbopack)4.645s (~)5.181s (~)0.535s62.16x
🌐 MongoDBNext.js (Turbopack)4.790s (+4.7%)5.187s (~)0.397s62.23x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)3.289s (-12.1% 🟢)3.715s (-14.2% 🟢)0.427s91.00x
▲ VercelNitro3.311s (-7.8% 🟢)3.960s (-6.2% 🟢)0.649s81.01x
▲ VercelExpress3.520s (+6.0% 🔺)4.386s (+11.3% 🔺)0.866s71.07x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)1.344s (-2.0%)2.008s (~)0.664s151.00x
🌐 RedisNext.js (Turbopack)1.379s (+1.2%)2.011s (~)0.632s151.03x
💻 LocalExpress1.412s (-1.2%)2.006s (~)0.594s151.05x
💻 LocalNext.js (Turbopack)1.418s (+3.0%)2.012s (~)0.594s151.06x
💻 LocalNitro1.424s (+0.9%)2.005s (~)0.581s151.06x
🐘 PostgresNext.js (Turbopack)1.708s (-2.8%)2.012s (~)0.304s151.27x
🐘 PostgresExpress1.910s (+0.6%)2.010s (-3.2%)0.101s151.42x
🐘 PostgresNitro1.930s (-2.4%)2.318s (+7.6% 🔺)0.388s131.44x
🌐 MongoDBNext.js (Turbopack)2.124s (~)3.016s (~)0.892s101.58x
🌐 TursoNext.js (Turbopack)2.224s (+4.7%)3.012s (~)0.788s101.66x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.724s (+0.6%)3.678s (-2.6%)0.954s91.00x
▲ VercelNext.js (Turbopack)2.792s (-0.9%)3.731s (-4.2%)0.939s91.03x
▲ VercelExpress2.845s (+8.0% 🔺)3.906s (+11.0% 🔺)1.061s81.04x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)2.142s (~)3.064s (+2.9%)0.923s101.00x
💻 LocalExpress2.191s (-5.9% 🟢)3.158s (-3.4%)0.967s101.02x
💻 LocalNitro2.322s (+2.7%)3.250s (+1.1%)0.928s101.08x
🌐 StarterNext.js (Turbopack)2.441s (~)3.009s (~)0.568s101.14x
🐘 PostgresNext.js (Turbopack)2.533s (+3.2%)3.032s (~)0.499s101.18x
🌐 RedisNext.js (Turbopack)2.540s (+2.6%)3.050s (+1.2%)0.510s101.19x
🐘 PostgresNitro2.634s (+2.0%)3.019s (~)0.386s101.23x
🐘 PostgresExpress2.734s (~)3.013s (~)0.278s101.28x
🌐 MongoDBNext.js (Turbopack)4.708s (-1.6%)5.184s (~)0.475s62.20x
🌐 TursoNext.js (Turbopack)4.724s (-2.3%)5.183s (-3.1%)0.459s62.21x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.956s (-8.2% 🟢)3.724s (+1.1%)0.768s91.00x
▲ VercelNitro3.087s (-3.5%)3.742s (-3.8%)0.654s91.04x
▲ VercelNext.js (Turbopack)3.104s (+0.6%)3.687s (-4.9%)0.583s91.05x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🌐 Starter🥇 Next.js (Turbopack)0.124s (-3.3%)1.005s (~)0.000s (+100.0% 🔺)1.013s (~)0.889s101.00x
💻 LocalNext.js (Turbopack)0.144s (+2.1%)1.003s (~)0.017s (+2.4%)1.029s (~)0.885s101.16x
🌐 RedisNext.js (Turbopack)0.145s (-1.4%)1.004s (~)0.000s (NaN%)1.014s (~)0.869s101.17x
💻 LocalExpress0.171s (-3.8%)0.992s (~)0.014s (-6.5% 🟢)1.021s (~)0.850s101.38x
💻 LocalNitro0.179s (+1.5%)0.992s (~)0.014s (-1.4%)1.021s (~)0.842s101.44x
🌐 TursoNext.js (Turbopack)0.466s (-9.2% 🟢)0.985s (+5.4% 🔺)0.000s (NaN%)1.013s (~)0.548s103.75x
🌐 MongoDBNext.js (Turbopack)0.479s (-9.3% 🟢)0.970s (+5.5% 🔺)0.000s (~)1.016s (~)0.537s103.87x
🐘 PostgresNext.js (Turbopack)0.811s (-44.3% 🟢)0.847s (-49.1% 🟢)0.001s (+Infinity% 🔺)1.018s (-49.5% 🟢)0.207s106.54x
🐘 PostgresNitro2.169s (-5.3% 🟢)2.877s (+4.5%)0.000s (-33.3% 🟢)3.014s (~)0.846s1017.49x
🐘 PostgresExpress2.335s (+2.4%)2.708s (-2.0%)0.000s (+Infinity% 🔺)3.016s (~)0.680s1018.83x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.668s (+4.7%)3.144s (+2.4%)0.363s (-21.2% 🟢)3.992s (+1.1%)1.324s101.00x
▲ VercelNext.js (Turbopack)2.778s (+7.2% 🔺)3.294s (+2.8%)0.368s (-72.5% 🟢)4.096s (-18.1% 🟢)1.317s101.04x
▲ VercelNitro2.854s (+5.2% 🔺)3.241s (+1.7%)0.384s (+11.3% 🔺)4.065s (+1.9%)1.211s101.07x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)6/8
🐘 PostgresNext.js (Turbopack)7/8
▲ VercelExpress4/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Starter6/8
Nitro💻 Local8/8
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
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

@github-actions

github-actionsBot commented Dec 28, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production278811297
✅ 💻 Local Development23508243
✅ 📦 Local Production26208270
✅ 🐘 Local Postgres26208270
❌ 🪟 Windows027027
❌ 🌍 Community Worlds81390120
Total111874351227

❌ Failed Tests

▲ Vercel Production (8 failed)

hono (8 failed):

  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter
🪟 Windows (27 failed)

nextjs-turbopack (27 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • webhook route with invalid token
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • retryAttemptCounterWorkflow
  • retryableAndFatalErrorWorkflow
  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter
🌍 Community Worlds (39 failed)

mongodb-dev (3 failed):

  • dev e2e should rebuild on step change
  • dev e2e should rebuild on workflow change
  • dev e2e should rebuild on adding workflow file

mongodb (27 failed):

  • addTenWorkflow
  • addTenWorkflow
  • should work with react rendering in step
  • promiseAllWorkflow
  • promiseRaceWorkflow
  • promiseAnyWorkflow
  • readableStreamWorkflow
  • hookWorkflow
  • webhookWorkflow
  • webhook route with invalid token
  • sleepingWorkflow
  • nullByteWorkflow
  • workflowAndStepMetadataWorkflow
  • outputStreamWorkflow
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions
  • fetchWorkflow
  • promiseRaceStressTestWorkflow
  • retryAttemptCounterWorkflow
  • retryableAndFatalErrorWorkflow
  • stepDirectCallWorkflow - calling step functions directly outside workflow context
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • 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 endpoint - workflow and step endpoints respond to __health query parameter

starter (8 failed):

  • addTenWorkflow
  • addTenWorkflow
  • retryAttemptCounterWorkflow
  • crossFileErrorWorkflow - stack traces work across imported modules
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step

turso (1 failed):

  • webhookWorkflow

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro2601
✅ example2601
✅ express2601
✅ fastify2601
❌ hono1881
✅ nextjs-turbopack2601
✅ nextjs-webpack2601
✅ nitro2601
✅ nuxt2601
✅ sveltekit2601
✅ vite2601
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
✅ nuxt-stable2601
✅ sveltekit-stable2601
✅ vite-stable2601
❌ 🪟 Windows
AppPassedFailedSkipped
❌ nextjs-turbopack0270
❌ 🌍 Community Worlds
AppPassedFailedSkipped
❌ mongodb-dev030
❌ mongodb0270
✅ redis-dev300
✅ redis2700
✅ starter-dev300
❌ starter1980
✅ turso-dev300
❌ turso2610

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@VaguelySerious

VaguelySerious commented Dec 28, 2025

Copy link
Copy Markdown
Member

I'm taking over responsibility for merging this code as if I wrote it (saying this to indicate that my DCO rights should apply to this code), so I can get this merged

Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@VaguelySerious

Copy link
Copy Markdown
Member

Shipped in @workflow/ai@4.0.1-beta.38

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@ctate@VaguelySerious@TooTallNate