ai sdk parity for DurableAgent - #668

Merged
pranaygp merged 15 commits into
mainfrom
ctate/da-parity
Dec 24, 2025
Merged

ai sdk parity for DurableAgent#668
pranaygp merged 15 commits into
mainfrom
ctate/da-parity

Conversation

@ctate

@ctatectate commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

Key Changes

Generation Settings

  • Support for temperature, maxOutputTokens, topP, topK, presencePenalty, frequencyPenalty, stopSequences, seed at constructor and per-stream level

Step Control

  • Added maxSteps to limit LLM calls (default: unlimited for backwards compatibility)
  • Added toolChoice (auto, none, required, or specific tool)
  • Added activeTools to filter available tools per-stream call

Callbacks

  • onChunk - called for each stream chunk
  • onStepFinish - called after each step completes
  • onFinish - called when all steps complete
  • onError - called on errors
  • onAbort - called when aborted via AbortSignal

Structured Output

  • Added experimental_output with Output.object({ schema }) for parsing structured responses

Context & Telemetry

  • Added experimental_context to pass data to tool executions
  • Added experimental_telemetry for observability

Stream Result

  • stream() now returns { messages, steps, experimental_output } instead of just { messages }

Other

  • prepareStep can now override generation settings, toolChoice, and context
  • Added experimental_repairToolCall for handling malformed tool calls
  • Enabled file, source, and tool input streaming chunks
  • Exported all new types from @workflow/ai

@vercel

vercelBot commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Dec 21, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0c0dfe1

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 21, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production286011297
❌ 💻 Local Development236268270
✅ 📦 Local Production26208270
✅ 🐘 Local Postgres26208270
❌ 🪟 Windows027027
❌ 🌍 Community Worlds58620120
Total1104115351254

❌ Failed Tests

💻 Local Development (26 failed)

nuxt-stable (26 failed):

  • addTenWorkflow
  • addTenWorkflow
  • 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
🪟 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 (62 failed)

mongodb (1 failed):

  • webhookWorkflow

redis (1 failed):

  • webhookWorkflow

starter-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

starter (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

turso-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

turso (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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro2601
✅ example2601
✅ express2601
✅ fastify2601
✅ hono2601
✅ nextjs-turbopack2601
✅ nextjs-webpack2601
✅ nitro2601
✅ nuxt2601
✅ sveltekit2601
✅ vite2601
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
❌ nuxt-stable0261
✅ 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-dev300
❌ mongodb2610
✅ redis-dev300
❌ redis2610
❌ starter-dev030
❌ starter0270
❌ turso-dev030
❌ turso0270

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Dec 21, 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
💻 Local🥇 Nitro0.031s (-26.1% 🟢)1.007s (~)0.975s101.00x
🌐 StarterNext.js (Turbopack)0.036s (-8.7% 🟢)1.014s (~)0.978s101.15x
🌐 RedisNext.js (Turbopack)0.037s (-8.2% 🟢)1.018s (~)0.982s101.18x
💻 LocalNext.js (Turbopack)0.038s (-4.5%)1.018s (~)0.980s101.21x
💻 LocalExpress0.042s (-5.8% 🟢)1.007s (~)0.965s101.35x
🌐 TursoNext.js (Turbopack)0.104s (-3.3%)1.014s (~)0.910s103.34x
🌐 MongoDBNext.js (Turbopack)0.110s (-12.9% 🟢)1.014s (~)0.904s103.52x
🐘 PostgresNitro0.201s (-11.7% 🟢)1.027s (+0.7%)0.827s106.43x
🐘 PostgresNext.js (Turbopack)0.247s (+11.7% 🔺)1.020s (~)0.773s107.92x
🐘 PostgresExpress0.380s (+28.2% 🔺)1.013s (~)0.633s1012.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.569s (-3.6%)1.560s (-2.5%)0.991s101.00x
▲ VercelNext.js (Turbopack)0.588s (-7.3% 🟢)1.642s (+10.5% 🔺)1.054s101.03x
▲ VercelNitro0.649s (+29.2% 🔺)1.603s (+6.1% 🔺)0.954s101.14x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.078s (-3.2%)2.005s (~)0.927s101.00x
🌐 RedisNext.js (Turbopack)1.082s (-1.6%)2.015s (~)0.933s101.00x
💻 LocalNext.js (Turbopack)1.095s (~)2.011s (~)0.917s101.02x
🌐 StarterNext.js (Turbopack)1.095s (~)2.009s (~)0.915s101.02x
💻 LocalExpress1.112s (~)2.006s (~)0.894s101.03x
🌐 TursoNext.js (Turbopack)1.306s (~)2.013s (~)0.706s101.21x
🌐 MongoDBNext.js (Turbopack)1.311s (~)2.013s (~)0.702s101.22x
🐘 PostgresNext.js (Turbopack)1.817s (-4.5%)2.015s (~)0.198s101.69x
🐘 PostgresExpress2.237s (+5.4% 🔺)3.015s (~)0.778s102.08x
🐘 PostgresNitro2.450s (+7.3% 🔺)3.014s (~)0.565s102.27x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.680s (~)3.564s (-1.5%)0.884s101.00x
▲ VercelNext.js (Turbopack)2.720s (-1.7%)3.807s (+3.9%)1.087s101.01x
▲ VercelExpress2.915s (-9.0% 🟢)3.798s (-8.9% 🟢)0.883s101.09x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.530s (-2.3%)11.011s (~)0.481s51.00x
🌐 RedisNext.js (Turbopack)10.592s (~)11.024s (~)0.432s51.01x
🌐 StarterNext.js (Turbopack)10.593s (~)11.010s (~)0.418s51.01x
💻 LocalNext.js (Turbopack)10.655s (~)11.016s (~)0.361s51.01x
💻 LocalExpress10.788s (~)11.013s (~)0.225s51.02x
🌐 TursoNext.js (Turbopack)12.184s (~)13.021s (~)0.837s51.16x
🌐 MongoDBNext.js (Turbopack)12.220s (~)13.021s (~)0.801s51.16x
🐘 PostgresNext.js (Turbopack)15.222s (+1.1%)16.037s (+2.6%)0.816s51.45x
🐘 PostgresExpress16.138s (-21.1% 🟢)16.831s (-20.0% 🟢)0.693s51.53x
🐘 PostgresNitro20.335s (~)21.039s (~)0.704s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.391s (+1.5%)22.091s (~)0.700s51.00x
▲ VercelNext.js (Turbopack)21.549s (+0.8%)22.240s (~)0.691s51.01x
▲ VercelNitro22.032s (~)22.680s (-1.1%)0.647s51.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.329s (-5.3% 🟢)2.006s (~)0.678s151.00x
🌐 StarterNext.js (Turbopack)1.344s (~)2.009s (~)0.665s151.01x
🌐 RedisNext.js (Turbopack)1.356s (~)2.012s (~)0.656s151.02x
💻 LocalNext.js (Turbopack)1.381s (-0.9%)2.012s (~)0.631s151.04x
💻 LocalExpress1.418s (~)2.007s (~)0.588s151.07x
🐘 PostgresNext.js (Turbopack)1.988s (-8.4% 🟢)2.325s (-3.1%)0.337s131.50x
🐘 PostgresExpress2.003s (-13.8% 🟢)2.225s (-26.2% 🟢)0.222s141.51x
🌐 MongoDBNext.js (Turbopack)2.135s (~)3.011s (~)0.876s101.61x
🌐 TursoNext.js (Turbopack)2.208s (~)3.013s (~)0.805s101.66x
🐘 PostgresNitro2.661s (+11.4% 🔺)3.013s (~)0.352s102.00x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.801s (-25.1% 🟢)3.588s (-22.2% 🟢)0.787s91.00x
▲ VercelExpress2.944s (-3.6%)3.818s (-3.8%)0.873s81.05x
▲ VercelNext.js (Turbopack)3.151s (+12.6% 🔺)3.923s (-0.7%)0.772s81.13x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.981s (-8.7% 🟢)2.159s (-29.1% 🟢)0.178s141.00x
💻 LocalNext.js (Turbopack)2.095s (-3.8%)2.945s (-5.8% 🟢)0.850s111.06x
💻 LocalExpress2.197s (-1.5%)3.124s (-1.4%)0.927s101.11x
🌐 RedisNext.js (Turbopack)2.401s (-0.5%)3.017s (~)0.615s101.21x
🌐 StarterNext.js (Turbopack)2.464s (+0.7%)3.009s (~)0.545s101.24x
🐘 PostgresNext.js (Turbopack)2.640s (-4.0%)3.017s (~)0.378s101.33x
🐘 PostgresExpress2.890s (-7.1% 🟢)3.011s (-20.3% 🟢)0.122s101.46x
🐘 PostgresNitro2.996s (-10.3% 🟢)3.361s (-16.6% 🟢)0.365s91.51x
🌐 TursoNext.js (Turbopack)4.685s (-1.3%)5.179s (~)0.494s62.37x
🌐 MongoDBNext.js (Turbopack)4.787s (+0.6%)5.179s (~)0.392s62.42x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.254s (-2.0%)3.847s (-2.0%)0.593s81.00x
▲ VercelExpress3.540s (-6.3% 🟢)4.122s (-13.6% 🟢)0.582s81.09x
▲ VercelNext.js (Turbopack)3.618s (-4.7%)4.338s (~)0.720s81.11x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.340s (-4.2%)2.006s (~)0.665s151.00x
💻 LocalNext.js (Turbopack)1.367s (-2.7%)2.011s (~)0.644s151.02x
🌐 StarterNext.js (Turbopack)1.371s (+1.6%)2.007s (~)0.636s151.02x
🌐 RedisNext.js (Turbopack)1.377s (-0.7%)2.012s (~)0.635s151.03x
💻 LocalExpress1.414s (-1.3%)2.005s (~)0.592s151.05x
🐘 PostgresExpress1.642s (-9.9% 🟢)2.010s (-6.7% 🟢)0.368s151.23x
🐘 PostgresNext.js (Turbopack)1.825s (-8.4% 🟢)2.012s (-7.1% 🟢)0.187s151.36x
🐘 PostgresNitro1.904s (+3.9%)2.237s (+3.9%)0.333s141.42x
🌐 MongoDBNext.js (Turbopack)2.147s (~)3.014s (~)0.867s101.60x
🌐 TursoNext.js (Turbopack)2.214s (-0.9%)3.011s (~)0.796s101.65x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.627s (-13.8% 🟢)3.680s (-6.5% 🟢)1.053s91.00x
▲ VercelNext.js (Turbopack)2.740s (-1.5%)3.778s (+5.5% 🔺)1.038s81.04x
▲ VercelNitro2.823s (-1.4%)3.686s (-3.7%)0.863s91.07x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro2.150s (-2.5%)3.035s (-3.4%)0.885s101.00x
💻 LocalNext.js (Turbopack)2.159s (-6.8% 🟢)3.125s (-4.3%)0.966s101.00x
💻 LocalExpress2.269s (-3.4%)3.198s (-2.3%)0.929s101.06x
🌐 RedisNext.js (Turbopack)2.375s (-1.7%)3.013s (~)0.638s101.10x
🌐 StarterNext.js (Turbopack)2.454s (~)3.010s (~)0.556s101.14x
🐘 PostgresExpress2.621s (-1.2%)3.023s (~)0.402s101.22x
🐘 PostgresNext.js (Turbopack)2.637s (+2.4%)3.021s (~)0.385s101.23x
🐘 PostgresNitro2.771s (~)3.011s (-3.7%)0.241s101.29x
🌐 TursoNext.js (Turbopack)4.748s (+0.9%)5.186s (~)0.438s62.21x
🌐 MongoDBNext.js (Turbopack)4.783s (~)5.179s (~)0.396s62.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.099s (+0.9%)3.810s (+3.2%)0.711s81.00x
▲ VercelNitro3.130s (+6.4% 🔺)3.720s (+2.8%)0.590s91.01x
▲ VercelNext.js (Turbopack)3.139s (-3.5%)3.719s (~)0.580s91.01x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.117s (-32.0% 🟢)0.999s (~)0.014s (-13.9% 🟢)1.020s (~)0.903s101.00x
🌐 RedisNext.js (Turbopack)0.121s (-9.6% 🟢)1.005s (~)0.000s (~)1.017s (~)0.896s101.03x
🌐 StarterNext.js (Turbopack)0.126s (-3.5%)1.005s (~)0.000s (-100.0% 🟢)1.011s (~)0.884s101.08x
💻 LocalNext.js (Turbopack)0.138s (-1.4%)1.003s (~)0.017s (-1.2%)1.028s (~)0.890s101.18x
💻 LocalExpress0.173s (-2.5%)0.993s (~)0.015s (+4.1%)1.022s (~)0.849s101.47x
🌐 MongoDBNext.js (Turbopack)0.480s (~)0.968s (~)0.000s (-100.0% 🟢)1.012s (~)0.533s104.09x
🌐 TursoNext.js (Turbopack)0.503s (+1.7%)0.949s (-0.6%)0.000s (-100.0% 🟢)1.014s (~)0.510s104.29x
🐘 PostgresNext.js (Turbopack)1.212s (+12.5% 🔺)1.831s (-7.2% 🟢)0.000s (NaN%)2.017s (~)0.805s1010.33x
🐘 PostgresExpress1.431s (-36.2% 🟢)1.655s (-40.9% 🟢)0.000s (-66.7% 🟢)2.014s (-33.2% 🟢)0.583s1012.20x
🐘 PostgresNitro2.153s (-2.2%)2.892s (+1.7%)0.000s (NaN%)3.016s (~)0.863s1018.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.581s (-6.5% 🟢)3.256s (-0.9%)0.907s (+151.4% 🔺)4.588s (+13.4% 🔺)2.007s101.00x
▲ VercelExpress2.700s (+4.6%)3.253s (-3.2%)0.934s (+100.7% 🔺)4.707s (+10.2% 🔺)2.007s101.05x
▲ VercelNitro2.805s (+11.1% 🔺)3.149s (+8.5% 🔺)0.876s (+32.8% 🔺)4.533s (+14.4% 🔺)1.727s101.09x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro8/8
🐘 PostgresNext.js (Turbopack)5/8
▲ VercelExpress4/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Redis3/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

I, Chris Tate <chris@ctate.dev>, hereby add my Signed-off-by to this commit: f41c090
Signed-off-by: Chris Tate <chris@ctate.dev>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive AI SDK parity features to the DurableAgent class, significantly expanding its capabilities to match the AI SDK's streamText functionality while maintaining workflow durability guarantees.

Key Changes:

  • Added generation settings support (temperature, maxOutputTokens, topP, topK, penalties, seed, etc.) at both constructor and per-stream levels
  • Implemented step control via maxSteps (defaults to unlimited for backwards compatibility), toolChoice, and activeTools filtering
  • Added lifecycle callbacks: onChunk, onStepFinish, onFinish, onError, and onAbort
  • Implemented structured output parsing via experimental_output with Output.object()
  • Added experimental context passing, telemetry, tool call repair, and stream transforms

Reviewed changes

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

Show a summary per file
FileDescription
packages/ai/src/index.tsExports DurableAgent, Output helper, and all new types for public API
packages/ai/src/agent/durable-agent.tsMain implementation: adds type definitions, enhances DurableAgent class with generation settings, callbacks, structured output, and tool filtering
packages/ai/src/agent/stream-text-iterator.tsImplements maxSteps limiting, abort signal handling, prepareStep enhancements for all generation settings, and callback integration
packages/ai/src/agent/do-stream-step.tsHandles generation settings application to model calls, implements transforms, onChunk callback, and enables file/source/tool-input streaming
packages/ai/src/agent/durable-agent.test.tsComprehensive test coverage for all new features including generation settings, maxSteps, toolChoice, activeTools, callbacks, context, and repair functions
docs/content/docs/api-reference/workflow-ai/durable-agent.mdxExtensive documentation with examples for all new features

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

Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/do-stream-step.ts Outdated
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/do-stream-step.ts
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threaddocs/content/docs/api-reference/workflow-ai/durable-agent.mdx Outdated
Comment thread.changeset/quiet-ears-punch.md Outdated
Comment thread.changeset/quiet-ears-punch.md Outdated
ctateand others added 3 commits December 22, 2025 18:43
Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Nathan Rajlich <n@n8.io>
Comment threadpackages/ai/src/agent/durable-agent.ts
const controller = new AbortController();

// Set a timeout to abort after 30 seconds
setTimeout(() => controller.abort(), 30000);

@pranaygppranaygpDec 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this doesn't work. You can't use setTimeout in the workflow context since it makes things non-deterministic. calling setTimeout will throw

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I took out the example

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.

5 participants

@ctate@avi1989@TooTallNate@pranaygp
, '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

ai sdk parity for DurableAgent - #668

Merged
pranaygp merged 15 commits into
mainfrom
ctate/da-parity
Dec 24, 2025
Merged

ai sdk parity for DurableAgent#668
pranaygp merged 15 commits into
mainfrom
ctate/da-parity

Conversation

@ctate

@ctatectate commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

Key Changes

Generation Settings

  • Support for temperature, maxOutputTokens, topP, topK, presencePenalty, frequencyPenalty, stopSequences, seed at constructor and per-stream level

Step Control

  • Added maxSteps to limit LLM calls (default: unlimited for backwards compatibility)
  • Added toolChoice (auto, none, required, or specific tool)
  • Added activeTools to filter available tools per-stream call

Callbacks

  • onChunk - called for each stream chunk
  • onStepFinish - called after each step completes
  • onFinish - called when all steps complete
  • onError - called on errors
  • onAbort - called when aborted via AbortSignal

Structured Output

  • Added experimental_output with Output.object({ schema }) for parsing structured responses

Context & Telemetry

  • Added experimental_context to pass data to tool executions
  • Added experimental_telemetry for observability

Stream Result

  • stream() now returns { messages, steps, experimental_output } instead of just { messages }

Other

  • prepareStep can now override generation settings, toolChoice, and context
  • Added experimental_repairToolCall for handling malformed tool calls
  • Enabled file, source, and tool input streaming chunks
  • Exported all new types from @workflow/ai

@vercel

vercelBot commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Dec 21, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0c0dfe1

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 21, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production286011297
❌ 💻 Local Development236268270
✅ 📦 Local Production26208270
✅ 🐘 Local Postgres26208270
❌ 🪟 Windows027027
❌ 🌍 Community Worlds58620120
Total1104115351254

❌ Failed Tests

💻 Local Development (26 failed)

nuxt-stable (26 failed):

  • addTenWorkflow
  • addTenWorkflow
  • 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
🪟 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 (62 failed)

mongodb (1 failed):

  • webhookWorkflow

redis (1 failed):

  • webhookWorkflow

starter-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

starter (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

turso-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

turso (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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro2601
✅ example2601
✅ express2601
✅ fastify2601
✅ hono2601
✅ nextjs-turbopack2601
✅ nextjs-webpack2601
✅ nitro2601
✅ nuxt2601
✅ sveltekit2601
✅ vite2601
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
❌ nuxt-stable0261
✅ 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-dev300
❌ mongodb2610
✅ redis-dev300
❌ redis2610
❌ starter-dev030
❌ starter0270
❌ turso-dev030
❌ turso0270

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Dec 21, 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
💻 Local🥇 Nitro0.031s (-26.1% 🟢)1.007s (~)0.975s101.00x
🌐 StarterNext.js (Turbopack)0.036s (-8.7% 🟢)1.014s (~)0.978s101.15x
🌐 RedisNext.js (Turbopack)0.037s (-8.2% 🟢)1.018s (~)0.982s101.18x
💻 LocalNext.js (Turbopack)0.038s (-4.5%)1.018s (~)0.980s101.21x
💻 LocalExpress0.042s (-5.8% 🟢)1.007s (~)0.965s101.35x
🌐 TursoNext.js (Turbopack)0.104s (-3.3%)1.014s (~)0.910s103.34x
🌐 MongoDBNext.js (Turbopack)0.110s (-12.9% 🟢)1.014s (~)0.904s103.52x
🐘 PostgresNitro0.201s (-11.7% 🟢)1.027s (+0.7%)0.827s106.43x
🐘 PostgresNext.js (Turbopack)0.247s (+11.7% 🔺)1.020s (~)0.773s107.92x
🐘 PostgresExpress0.380s (+28.2% 🔺)1.013s (~)0.633s1012.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.569s (-3.6%)1.560s (-2.5%)0.991s101.00x
▲ VercelNext.js (Turbopack)0.588s (-7.3% 🟢)1.642s (+10.5% 🔺)1.054s101.03x
▲ VercelNitro0.649s (+29.2% 🔺)1.603s (+6.1% 🔺)0.954s101.14x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.078s (-3.2%)2.005s (~)0.927s101.00x
🌐 RedisNext.js (Turbopack)1.082s (-1.6%)2.015s (~)0.933s101.00x
💻 LocalNext.js (Turbopack)1.095s (~)2.011s (~)0.917s101.02x
🌐 StarterNext.js (Turbopack)1.095s (~)2.009s (~)0.915s101.02x
💻 LocalExpress1.112s (~)2.006s (~)0.894s101.03x
🌐 TursoNext.js (Turbopack)1.306s (~)2.013s (~)0.706s101.21x
🌐 MongoDBNext.js (Turbopack)1.311s (~)2.013s (~)0.702s101.22x
🐘 PostgresNext.js (Turbopack)1.817s (-4.5%)2.015s (~)0.198s101.69x
🐘 PostgresExpress2.237s (+5.4% 🔺)3.015s (~)0.778s102.08x
🐘 PostgresNitro2.450s (+7.3% 🔺)3.014s (~)0.565s102.27x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.680s (~)3.564s (-1.5%)0.884s101.00x
▲ VercelNext.js (Turbopack)2.720s (-1.7%)3.807s (+3.9%)1.087s101.01x
▲ VercelExpress2.915s (-9.0% 🟢)3.798s (-8.9% 🟢)0.883s101.09x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.530s (-2.3%)11.011s (~)0.481s51.00x
🌐 RedisNext.js (Turbopack)10.592s (~)11.024s (~)0.432s51.01x
🌐 StarterNext.js (Turbopack)10.593s (~)11.010s (~)0.418s51.01x
💻 LocalNext.js (Turbopack)10.655s (~)11.016s (~)0.361s51.01x
💻 LocalExpress10.788s (~)11.013s (~)0.225s51.02x
🌐 TursoNext.js (Turbopack)12.184s (~)13.021s (~)0.837s51.16x
🌐 MongoDBNext.js (Turbopack)12.220s (~)13.021s (~)0.801s51.16x
🐘 PostgresNext.js (Turbopack)15.222s (+1.1%)16.037s (+2.6%)0.816s51.45x
🐘 PostgresExpress16.138s (-21.1% 🟢)16.831s (-20.0% 🟢)0.693s51.53x
🐘 PostgresNitro20.335s (~)21.039s (~)0.704s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.391s (+1.5%)22.091s (~)0.700s51.00x
▲ VercelNext.js (Turbopack)21.549s (+0.8%)22.240s (~)0.691s51.01x
▲ VercelNitro22.032s (~)22.680s (-1.1%)0.647s51.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.329s (-5.3% 🟢)2.006s (~)0.678s151.00x
🌐 StarterNext.js (Turbopack)1.344s (~)2.009s (~)0.665s151.01x
🌐 RedisNext.js (Turbopack)1.356s (~)2.012s (~)0.656s151.02x
💻 LocalNext.js (Turbopack)1.381s (-0.9%)2.012s (~)0.631s151.04x
💻 LocalExpress1.418s (~)2.007s (~)0.588s151.07x
🐘 PostgresNext.js (Turbopack)1.988s (-8.4% 🟢)2.325s (-3.1%)0.337s131.50x
🐘 PostgresExpress2.003s (-13.8% 🟢)2.225s (-26.2% 🟢)0.222s141.51x
🌐 MongoDBNext.js (Turbopack)2.135s (~)3.011s (~)0.876s101.61x
🌐 TursoNext.js (Turbopack)2.208s (~)3.013s (~)0.805s101.66x
🐘 PostgresNitro2.661s (+11.4% 🔺)3.013s (~)0.352s102.00x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.801s (-25.1% 🟢)3.588s (-22.2% 🟢)0.787s91.00x
▲ VercelExpress2.944s (-3.6%)3.818s (-3.8%)0.873s81.05x
▲ VercelNext.js (Turbopack)3.151s (+12.6% 🔺)3.923s (-0.7%)0.772s81.13x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.981s (-8.7% 🟢)2.159s (-29.1% 🟢)0.178s141.00x
💻 LocalNext.js (Turbopack)2.095s (-3.8%)2.945s (-5.8% 🟢)0.850s111.06x
💻 LocalExpress2.197s (-1.5%)3.124s (-1.4%)0.927s101.11x
🌐 RedisNext.js (Turbopack)2.401s (-0.5%)3.017s (~)0.615s101.21x
🌐 StarterNext.js (Turbopack)2.464s (+0.7%)3.009s (~)0.545s101.24x
🐘 PostgresNext.js (Turbopack)2.640s (-4.0%)3.017s (~)0.378s101.33x
🐘 PostgresExpress2.890s (-7.1% 🟢)3.011s (-20.3% 🟢)0.122s101.46x
🐘 PostgresNitro2.996s (-10.3% 🟢)3.361s (-16.6% 🟢)0.365s91.51x
🌐 TursoNext.js (Turbopack)4.685s (-1.3%)5.179s (~)0.494s62.37x
🌐 MongoDBNext.js (Turbopack)4.787s (+0.6%)5.179s (~)0.392s62.42x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.254s (-2.0%)3.847s (-2.0%)0.593s81.00x
▲ VercelExpress3.540s (-6.3% 🟢)4.122s (-13.6% 🟢)0.582s81.09x
▲ VercelNext.js (Turbopack)3.618s (-4.7%)4.338s (~)0.720s81.11x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.340s (-4.2%)2.006s (~)0.665s151.00x
💻 LocalNext.js (Turbopack)1.367s (-2.7%)2.011s (~)0.644s151.02x
🌐 StarterNext.js (Turbopack)1.371s (+1.6%)2.007s (~)0.636s151.02x
🌐 RedisNext.js (Turbopack)1.377s (-0.7%)2.012s (~)0.635s151.03x
💻 LocalExpress1.414s (-1.3%)2.005s (~)0.592s151.05x
🐘 PostgresExpress1.642s (-9.9% 🟢)2.010s (-6.7% 🟢)0.368s151.23x
🐘 PostgresNext.js (Turbopack)1.825s (-8.4% 🟢)2.012s (-7.1% 🟢)0.187s151.36x
🐘 PostgresNitro1.904s (+3.9%)2.237s (+3.9%)0.333s141.42x
🌐 MongoDBNext.js (Turbopack)2.147s (~)3.014s (~)0.867s101.60x
🌐 TursoNext.js (Turbopack)2.214s (-0.9%)3.011s (~)0.796s101.65x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.627s (-13.8% 🟢)3.680s (-6.5% 🟢)1.053s91.00x
▲ VercelNext.js (Turbopack)2.740s (-1.5%)3.778s (+5.5% 🔺)1.038s81.04x
▲ VercelNitro2.823s (-1.4%)3.686s (-3.7%)0.863s91.07x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro2.150s (-2.5%)3.035s (-3.4%)0.885s101.00x
💻 LocalNext.js (Turbopack)2.159s (-6.8% 🟢)3.125s (-4.3%)0.966s101.00x
💻 LocalExpress2.269s (-3.4%)3.198s (-2.3%)0.929s101.06x
🌐 RedisNext.js (Turbopack)2.375s (-1.7%)3.013s (~)0.638s101.10x
🌐 StarterNext.js (Turbopack)2.454s (~)3.010s (~)0.556s101.14x
🐘 PostgresExpress2.621s (-1.2%)3.023s (~)0.402s101.22x
🐘 PostgresNext.js (Turbopack)2.637s (+2.4%)3.021s (~)0.385s101.23x
🐘 PostgresNitro2.771s (~)3.011s (-3.7%)0.241s101.29x
🌐 TursoNext.js (Turbopack)4.748s (+0.9%)5.186s (~)0.438s62.21x
🌐 MongoDBNext.js (Turbopack)4.783s (~)5.179s (~)0.396s62.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.099s (+0.9%)3.810s (+3.2%)0.711s81.00x
▲ VercelNitro3.130s (+6.4% 🔺)3.720s (+2.8%)0.590s91.01x
▲ VercelNext.js (Turbopack)3.139s (-3.5%)3.719s (~)0.580s91.01x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.117s (-32.0% 🟢)0.999s (~)0.014s (-13.9% 🟢)1.020s (~)0.903s101.00x
🌐 RedisNext.js (Turbopack)0.121s (-9.6% 🟢)1.005s (~)0.000s (~)1.017s (~)0.896s101.03x
🌐 StarterNext.js (Turbopack)0.126s (-3.5%)1.005s (~)0.000s (-100.0% 🟢)1.011s (~)0.884s101.08x
💻 LocalNext.js (Turbopack)0.138s (-1.4%)1.003s (~)0.017s (-1.2%)1.028s (~)0.890s101.18x
💻 LocalExpress0.173s (-2.5%)0.993s (~)0.015s (+4.1%)1.022s (~)0.849s101.47x
🌐 MongoDBNext.js (Turbopack)0.480s (~)0.968s (~)0.000s (-100.0% 🟢)1.012s (~)0.533s104.09x
🌐 TursoNext.js (Turbopack)0.503s (+1.7%)0.949s (-0.6%)0.000s (-100.0% 🟢)1.014s (~)0.510s104.29x
🐘 PostgresNext.js (Turbopack)1.212s (+12.5% 🔺)1.831s (-7.2% 🟢)0.000s (NaN%)2.017s (~)0.805s1010.33x
🐘 PostgresExpress1.431s (-36.2% 🟢)1.655s (-40.9% 🟢)0.000s (-66.7% 🟢)2.014s (-33.2% 🟢)0.583s1012.20x
🐘 PostgresNitro2.153s (-2.2%)2.892s (+1.7%)0.000s (NaN%)3.016s (~)0.863s1018.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.581s (-6.5% 🟢)3.256s (-0.9%)0.907s (+151.4% 🔺)4.588s (+13.4% 🔺)2.007s101.00x
▲ VercelExpress2.700s (+4.6%)3.253s (-3.2%)0.934s (+100.7% 🔺)4.707s (+10.2% 🔺)2.007s101.05x
▲ VercelNitro2.805s (+11.1% 🔺)3.149s (+8.5% 🔺)0.876s (+32.8% 🔺)4.533s (+14.4% 🔺)1.727s101.09x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro8/8
🐘 PostgresNext.js (Turbopack)5/8
▲ VercelExpress4/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Redis3/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

I, Chris Tate <chris@ctate.dev>, hereby add my Signed-off-by to this commit: f41c090
Signed-off-by: Chris Tate <chris@ctate.dev>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive AI SDK parity features to the DurableAgent class, significantly expanding its capabilities to match the AI SDK's streamText functionality while maintaining workflow durability guarantees.

Key Changes:

  • Added generation settings support (temperature, maxOutputTokens, topP, topK, penalties, seed, etc.) at both constructor and per-stream levels
  • Implemented step control via maxSteps (defaults to unlimited for backwards compatibility), toolChoice, and activeTools filtering
  • Added lifecycle callbacks: onChunk, onStepFinish, onFinish, onError, and onAbort
  • Implemented structured output parsing via experimental_output with Output.object()
  • Added experimental context passing, telemetry, tool call repair, and stream transforms

Reviewed changes

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

Show a summary per file
FileDescription
packages/ai/src/index.tsExports DurableAgent, Output helper, and all new types for public API
packages/ai/src/agent/durable-agent.tsMain implementation: adds type definitions, enhances DurableAgent class with generation settings, callbacks, structured output, and tool filtering
packages/ai/src/agent/stream-text-iterator.tsImplements maxSteps limiting, abort signal handling, prepareStep enhancements for all generation settings, and callback integration
packages/ai/src/agent/do-stream-step.tsHandles generation settings application to model calls, implements transforms, onChunk callback, and enables file/source/tool-input streaming
packages/ai/src/agent/durable-agent.test.tsComprehensive test coverage for all new features including generation settings, maxSteps, toolChoice, activeTools, callbacks, context, and repair functions
docs/content/docs/api-reference/workflow-ai/durable-agent.mdxExtensive documentation with examples for all new features

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

Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/do-stream-step.ts Outdated
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/do-stream-step.ts
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threaddocs/content/docs/api-reference/workflow-ai/durable-agent.mdx Outdated
Comment thread.changeset/quiet-ears-punch.md Outdated
Comment thread.changeset/quiet-ears-punch.md Outdated
ctateand others added 3 commits December 22, 2025 18:43
Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Nathan Rajlich <n@n8.io>
Comment threadpackages/ai/src/agent/durable-agent.ts
const controller = new AbortController();

// Set a timeout to abort after 30 seconds
setTimeout(() => controller.abort(), 30000);

@pranaygppranaygpDec 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this doesn't work. You can't use setTimeout in the workflow context since it makes things non-deterministic. calling setTimeout will throw

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I took out the example

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.

5 participants

@ctate@avi1989@TooTallNate@pranaygp
, '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

ai sdk parity for DurableAgent - #668

Merged
pranaygp merged 15 commits into
mainfrom
ctate/da-parity
Dec 24, 2025
Merged

ai sdk parity for DurableAgent#668
pranaygp merged 15 commits into
mainfrom
ctate/da-parity

Conversation

@ctate

@ctatectate commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

Key Changes

Generation Settings

  • Support for temperature, maxOutputTokens, topP, topK, presencePenalty, frequencyPenalty, stopSequences, seed at constructor and per-stream level

Step Control

  • Added maxSteps to limit LLM calls (default: unlimited for backwards compatibility)
  • Added toolChoice (auto, none, required, or specific tool)
  • Added activeTools to filter available tools per-stream call

Callbacks

  • onChunk - called for each stream chunk
  • onStepFinish - called after each step completes
  • onFinish - called when all steps complete
  • onError - called on errors
  • onAbort - called when aborted via AbortSignal

Structured Output

  • Added experimental_output with Output.object({ schema }) for parsing structured responses

Context & Telemetry

  • Added experimental_context to pass data to tool executions
  • Added experimental_telemetry for observability

Stream Result

  • stream() now returns { messages, steps, experimental_output } instead of just { messages }

Other

  • prepareStep can now override generation settings, toolChoice, and context
  • Added experimental_repairToolCall for handling malformed tool calls
  • Enabled file, source, and tool input streaming chunks
  • Exported all new types from @workflow/ai

@vercel

vercelBot commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Dec 21, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0c0dfe1

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 21, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production286011297
❌ 💻 Local Development236268270
✅ 📦 Local Production26208270
✅ 🐘 Local Postgres26208270
❌ 🪟 Windows027027
❌ 🌍 Community Worlds58620120
Total1104115351254

❌ Failed Tests

💻 Local Development (26 failed)

nuxt-stable (26 failed):

  • addTenWorkflow
  • addTenWorkflow
  • 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
🪟 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 (62 failed)

mongodb (1 failed):

  • webhookWorkflow

redis (1 failed):

  • webhookWorkflow

starter-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

starter (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

turso-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

turso (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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro2601
✅ example2601
✅ express2601
✅ fastify2601
✅ hono2601
✅ nextjs-turbopack2601
✅ nextjs-webpack2601
✅ nitro2601
✅ nuxt2601
✅ sveltekit2601
✅ vite2601
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
❌ nuxt-stable0261
✅ 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-dev300
❌ mongodb2610
✅ redis-dev300
❌ redis2610
❌ starter-dev030
❌ starter0270
❌ turso-dev030
❌ turso0270

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Dec 21, 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
💻 Local🥇 Nitro0.031s (-26.1% 🟢)1.007s (~)0.975s101.00x
🌐 StarterNext.js (Turbopack)0.036s (-8.7% 🟢)1.014s (~)0.978s101.15x
🌐 RedisNext.js (Turbopack)0.037s (-8.2% 🟢)1.018s (~)0.982s101.18x
💻 LocalNext.js (Turbopack)0.038s (-4.5%)1.018s (~)0.980s101.21x
💻 LocalExpress0.042s (-5.8% 🟢)1.007s (~)0.965s101.35x
🌐 TursoNext.js (Turbopack)0.104s (-3.3%)1.014s (~)0.910s103.34x
🌐 MongoDBNext.js (Turbopack)0.110s (-12.9% 🟢)1.014s (~)0.904s103.52x
🐘 PostgresNitro0.201s (-11.7% 🟢)1.027s (+0.7%)0.827s106.43x
🐘 PostgresNext.js (Turbopack)0.247s (+11.7% 🔺)1.020s (~)0.773s107.92x
🐘 PostgresExpress0.380s (+28.2% 🔺)1.013s (~)0.633s1012.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.569s (-3.6%)1.560s (-2.5%)0.991s101.00x
▲ VercelNext.js (Turbopack)0.588s (-7.3% 🟢)1.642s (+10.5% 🔺)1.054s101.03x
▲ VercelNitro0.649s (+29.2% 🔺)1.603s (+6.1% 🔺)0.954s101.14x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.078s (-3.2%)2.005s (~)0.927s101.00x
🌐 RedisNext.js (Turbopack)1.082s (-1.6%)2.015s (~)0.933s101.00x
💻 LocalNext.js (Turbopack)1.095s (~)2.011s (~)0.917s101.02x
🌐 StarterNext.js (Turbopack)1.095s (~)2.009s (~)0.915s101.02x
💻 LocalExpress1.112s (~)2.006s (~)0.894s101.03x
🌐 TursoNext.js (Turbopack)1.306s (~)2.013s (~)0.706s101.21x
🌐 MongoDBNext.js (Turbopack)1.311s (~)2.013s (~)0.702s101.22x
🐘 PostgresNext.js (Turbopack)1.817s (-4.5%)2.015s (~)0.198s101.69x
🐘 PostgresExpress2.237s (+5.4% 🔺)3.015s (~)0.778s102.08x
🐘 PostgresNitro2.450s (+7.3% 🔺)3.014s (~)0.565s102.27x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.680s (~)3.564s (-1.5%)0.884s101.00x
▲ VercelNext.js (Turbopack)2.720s (-1.7%)3.807s (+3.9%)1.087s101.01x
▲ VercelExpress2.915s (-9.0% 🟢)3.798s (-8.9% 🟢)0.883s101.09x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.530s (-2.3%)11.011s (~)0.481s51.00x
🌐 RedisNext.js (Turbopack)10.592s (~)11.024s (~)0.432s51.01x
🌐 StarterNext.js (Turbopack)10.593s (~)11.010s (~)0.418s51.01x
💻 LocalNext.js (Turbopack)10.655s (~)11.016s (~)0.361s51.01x
💻 LocalExpress10.788s (~)11.013s (~)0.225s51.02x
🌐 TursoNext.js (Turbopack)12.184s (~)13.021s (~)0.837s51.16x
🌐 MongoDBNext.js (Turbopack)12.220s (~)13.021s (~)0.801s51.16x
🐘 PostgresNext.js (Turbopack)15.222s (+1.1%)16.037s (+2.6%)0.816s51.45x
🐘 PostgresExpress16.138s (-21.1% 🟢)16.831s (-20.0% 🟢)0.693s51.53x
🐘 PostgresNitro20.335s (~)21.039s (~)0.704s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.391s (+1.5%)22.091s (~)0.700s51.00x
▲ VercelNext.js (Turbopack)21.549s (+0.8%)22.240s (~)0.691s51.01x
▲ VercelNitro22.032s (~)22.680s (-1.1%)0.647s51.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.329s (-5.3% 🟢)2.006s (~)0.678s151.00x
🌐 StarterNext.js (Turbopack)1.344s (~)2.009s (~)0.665s151.01x
🌐 RedisNext.js (Turbopack)1.356s (~)2.012s (~)0.656s151.02x
💻 LocalNext.js (Turbopack)1.381s (-0.9%)2.012s (~)0.631s151.04x
💻 LocalExpress1.418s (~)2.007s (~)0.588s151.07x
🐘 PostgresNext.js (Turbopack)1.988s (-8.4% 🟢)2.325s (-3.1%)0.337s131.50x
🐘 PostgresExpress2.003s (-13.8% 🟢)2.225s (-26.2% 🟢)0.222s141.51x
🌐 MongoDBNext.js (Turbopack)2.135s (~)3.011s (~)0.876s101.61x
🌐 TursoNext.js (Turbopack)2.208s (~)3.013s (~)0.805s101.66x
🐘 PostgresNitro2.661s (+11.4% 🔺)3.013s (~)0.352s102.00x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.801s (-25.1% 🟢)3.588s (-22.2% 🟢)0.787s91.00x
▲ VercelExpress2.944s (-3.6%)3.818s (-3.8%)0.873s81.05x
▲ VercelNext.js (Turbopack)3.151s (+12.6% 🔺)3.923s (-0.7%)0.772s81.13x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.981s (-8.7% 🟢)2.159s (-29.1% 🟢)0.178s141.00x
💻 LocalNext.js (Turbopack)2.095s (-3.8%)2.945s (-5.8% 🟢)0.850s111.06x
💻 LocalExpress2.197s (-1.5%)3.124s (-1.4%)0.927s101.11x
🌐 RedisNext.js (Turbopack)2.401s (-0.5%)3.017s (~)0.615s101.21x
🌐 StarterNext.js (Turbopack)2.464s (+0.7%)3.009s (~)0.545s101.24x
🐘 PostgresNext.js (Turbopack)2.640s (-4.0%)3.017s (~)0.378s101.33x
🐘 PostgresExpress2.890s (-7.1% 🟢)3.011s (-20.3% 🟢)0.122s101.46x
🐘 PostgresNitro2.996s (-10.3% 🟢)3.361s (-16.6% 🟢)0.365s91.51x
🌐 TursoNext.js (Turbopack)4.685s (-1.3%)5.179s (~)0.494s62.37x
🌐 MongoDBNext.js (Turbopack)4.787s (+0.6%)5.179s (~)0.392s62.42x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.254s (-2.0%)3.847s (-2.0%)0.593s81.00x
▲ VercelExpress3.540s (-6.3% 🟢)4.122s (-13.6% 🟢)0.582s81.09x
▲ VercelNext.js (Turbopack)3.618s (-4.7%)4.338s (~)0.720s81.11x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.340s (-4.2%)2.006s (~)0.665s151.00x
💻 LocalNext.js (Turbopack)1.367s (-2.7%)2.011s (~)0.644s151.02x
🌐 StarterNext.js (Turbopack)1.371s (+1.6%)2.007s (~)0.636s151.02x
🌐 RedisNext.js (Turbopack)1.377s (-0.7%)2.012s (~)0.635s151.03x
💻 LocalExpress1.414s (-1.3%)2.005s (~)0.592s151.05x
🐘 PostgresExpress1.642s (-9.9% 🟢)2.010s (-6.7% 🟢)0.368s151.23x
🐘 PostgresNext.js (Turbopack)1.825s (-8.4% 🟢)2.012s (-7.1% 🟢)0.187s151.36x
🐘 PostgresNitro1.904s (+3.9%)2.237s (+3.9%)0.333s141.42x
🌐 MongoDBNext.js (Turbopack)2.147s (~)3.014s (~)0.867s101.60x
🌐 TursoNext.js (Turbopack)2.214s (-0.9%)3.011s (~)0.796s101.65x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.627s (-13.8% 🟢)3.680s (-6.5% 🟢)1.053s91.00x
▲ VercelNext.js (Turbopack)2.740s (-1.5%)3.778s (+5.5% 🔺)1.038s81.04x
▲ VercelNitro2.823s (-1.4%)3.686s (-3.7%)0.863s91.07x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro2.150s (-2.5%)3.035s (-3.4%)0.885s101.00x
💻 LocalNext.js (Turbopack)2.159s (-6.8% 🟢)3.125s (-4.3%)0.966s101.00x
💻 LocalExpress2.269s (-3.4%)3.198s (-2.3%)0.929s101.06x
🌐 RedisNext.js (Turbopack)2.375s (-1.7%)3.013s (~)0.638s101.10x
🌐 StarterNext.js (Turbopack)2.454s (~)3.010s (~)0.556s101.14x
🐘 PostgresExpress2.621s (-1.2%)3.023s (~)0.402s101.22x
🐘 PostgresNext.js (Turbopack)2.637s (+2.4%)3.021s (~)0.385s101.23x
🐘 PostgresNitro2.771s (~)3.011s (-3.7%)0.241s101.29x
🌐 TursoNext.js (Turbopack)4.748s (+0.9%)5.186s (~)0.438s62.21x
🌐 MongoDBNext.js (Turbopack)4.783s (~)5.179s (~)0.396s62.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.099s (+0.9%)3.810s (+3.2%)0.711s81.00x
▲ VercelNitro3.130s (+6.4% 🔺)3.720s (+2.8%)0.590s91.01x
▲ VercelNext.js (Turbopack)3.139s (-3.5%)3.719s (~)0.580s91.01x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.117s (-32.0% 🟢)0.999s (~)0.014s (-13.9% 🟢)1.020s (~)0.903s101.00x
🌐 RedisNext.js (Turbopack)0.121s (-9.6% 🟢)1.005s (~)0.000s (~)1.017s (~)0.896s101.03x
🌐 StarterNext.js (Turbopack)0.126s (-3.5%)1.005s (~)0.000s (-100.0% 🟢)1.011s (~)0.884s101.08x
💻 LocalNext.js (Turbopack)0.138s (-1.4%)1.003s (~)0.017s (-1.2%)1.028s (~)0.890s101.18x
💻 LocalExpress0.173s (-2.5%)0.993s (~)0.015s (+4.1%)1.022s (~)0.849s101.47x
🌐 MongoDBNext.js (Turbopack)0.480s (~)0.968s (~)0.000s (-100.0% 🟢)1.012s (~)0.533s104.09x
🌐 TursoNext.js (Turbopack)0.503s (+1.7%)0.949s (-0.6%)0.000s (-100.0% 🟢)1.014s (~)0.510s104.29x
🐘 PostgresNext.js (Turbopack)1.212s (+12.5% 🔺)1.831s (-7.2% 🟢)0.000s (NaN%)2.017s (~)0.805s1010.33x
🐘 PostgresExpress1.431s (-36.2% 🟢)1.655s (-40.9% 🟢)0.000s (-66.7% 🟢)2.014s (-33.2% 🟢)0.583s1012.20x
🐘 PostgresNitro2.153s (-2.2%)2.892s (+1.7%)0.000s (NaN%)3.016s (~)0.863s1018.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.581s (-6.5% 🟢)3.256s (-0.9%)0.907s (+151.4% 🔺)4.588s (+13.4% 🔺)2.007s101.00x
▲ VercelExpress2.700s (+4.6%)3.253s (-3.2%)0.934s (+100.7% 🔺)4.707s (+10.2% 🔺)2.007s101.05x
▲ VercelNitro2.805s (+11.1% 🔺)3.149s (+8.5% 🔺)0.876s (+32.8% 🔺)4.533s (+14.4% 🔺)1.727s101.09x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro8/8
🐘 PostgresNext.js (Turbopack)5/8
▲ VercelExpress4/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Redis3/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

I, Chris Tate <chris@ctate.dev>, hereby add my Signed-off-by to this commit: f41c090
Signed-off-by: Chris Tate <chris@ctate.dev>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive AI SDK parity features to the DurableAgent class, significantly expanding its capabilities to match the AI SDK's streamText functionality while maintaining workflow durability guarantees.

Key Changes:

  • Added generation settings support (temperature, maxOutputTokens, topP, topK, penalties, seed, etc.) at both constructor and per-stream levels
  • Implemented step control via maxSteps (defaults to unlimited for backwards compatibility), toolChoice, and activeTools filtering
  • Added lifecycle callbacks: onChunk, onStepFinish, onFinish, onError, and onAbort
  • Implemented structured output parsing via experimental_output with Output.object()
  • Added experimental context passing, telemetry, tool call repair, and stream transforms

Reviewed changes

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

Show a summary per file
FileDescription
packages/ai/src/index.tsExports DurableAgent, Output helper, and all new types for public API
packages/ai/src/agent/durable-agent.tsMain implementation: adds type definitions, enhances DurableAgent class with generation settings, callbacks, structured output, and tool filtering
packages/ai/src/agent/stream-text-iterator.tsImplements maxSteps limiting, abort signal handling, prepareStep enhancements for all generation settings, and callback integration
packages/ai/src/agent/do-stream-step.tsHandles generation settings application to model calls, implements transforms, onChunk callback, and enables file/source/tool-input streaming
packages/ai/src/agent/durable-agent.test.tsComprehensive test coverage for all new features including generation settings, maxSteps, toolChoice, activeTools, callbacks, context, and repair functions
docs/content/docs/api-reference/workflow-ai/durable-agent.mdxExtensive documentation with examples for all new features

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

Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/do-stream-step.ts Outdated
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/do-stream-step.ts
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threaddocs/content/docs/api-reference/workflow-ai/durable-agent.mdx Outdated
Comment thread.changeset/quiet-ears-punch.md Outdated
Comment thread.changeset/quiet-ears-punch.md Outdated
ctateand others added 3 commits December 22, 2025 18:43
Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Nathan Rajlich <n@n8.io>
Comment threadpackages/ai/src/agent/durable-agent.ts
const controller = new AbortController();

// Set a timeout to abort after 30 seconds
setTimeout(() => controller.abort(), 30000);

@pranaygppranaygpDec 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this doesn't work. You can't use setTimeout in the workflow context since it makes things non-deterministic. calling setTimeout will throw

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I took out the example

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.

5 participants

@ctate@avi1989@TooTallNate@pranaygp
, '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

ai sdk parity for DurableAgent - #668

Merged
pranaygp merged 15 commits into
mainfrom
ctate/da-parity
Dec 24, 2025
Merged

ai sdk parity for DurableAgent#668
pranaygp merged 15 commits into
mainfrom
ctate/da-parity

Conversation

@ctate

@ctatectate commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

Key Changes

Generation Settings

  • Support for temperature, maxOutputTokens, topP, topK, presencePenalty, frequencyPenalty, stopSequences, seed at constructor and per-stream level

Step Control

  • Added maxSteps to limit LLM calls (default: unlimited for backwards compatibility)
  • Added toolChoice (auto, none, required, or specific tool)
  • Added activeTools to filter available tools per-stream call

Callbacks

  • onChunk - called for each stream chunk
  • onStepFinish - called after each step completes
  • onFinish - called when all steps complete
  • onError - called on errors
  • onAbort - called when aborted via AbortSignal

Structured Output

  • Added experimental_output with Output.object({ schema }) for parsing structured responses

Context & Telemetry

  • Added experimental_context to pass data to tool executions
  • Added experimental_telemetry for observability

Stream Result

  • stream() now returns { messages, steps, experimental_output } instead of just { messages }

Other

  • prepareStep can now override generation settings, toolChoice, and context
  • Added experimental_repairToolCall for handling malformed tool calls
  • Enabled file, source, and tool input streaming chunks
  • Exported all new types from @workflow/ai

@vercel

vercelBot commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Dec 21, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0c0dfe1

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 21, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production286011297
❌ 💻 Local Development236268270
✅ 📦 Local Production26208270
✅ 🐘 Local Postgres26208270
❌ 🪟 Windows027027
❌ 🌍 Community Worlds58620120
Total1104115351254

❌ Failed Tests

💻 Local Development (26 failed)

nuxt-stable (26 failed):

  • addTenWorkflow
  • addTenWorkflow
  • 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
🪟 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 (62 failed)

mongodb (1 failed):

  • webhookWorkflow

redis (1 failed):

  • webhookWorkflow

starter-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

starter (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

turso-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

turso (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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro2601
✅ example2601
✅ express2601
✅ fastify2601
✅ hono2601
✅ nextjs-turbopack2601
✅ nextjs-webpack2601
✅ nitro2601
✅ nuxt2601
✅ sveltekit2601
✅ vite2601
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
❌ nuxt-stable0261
✅ 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-dev300
❌ mongodb2610
✅ redis-dev300
❌ redis2610
❌ starter-dev030
❌ starter0270
❌ turso-dev030
❌ turso0270

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Dec 21, 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
💻 Local🥇 Nitro0.031s (-26.1% 🟢)1.007s (~)0.975s101.00x
🌐 StarterNext.js (Turbopack)0.036s (-8.7% 🟢)1.014s (~)0.978s101.15x
🌐 RedisNext.js (Turbopack)0.037s (-8.2% 🟢)1.018s (~)0.982s101.18x
💻 LocalNext.js (Turbopack)0.038s (-4.5%)1.018s (~)0.980s101.21x
💻 LocalExpress0.042s (-5.8% 🟢)1.007s (~)0.965s101.35x
🌐 TursoNext.js (Turbopack)0.104s (-3.3%)1.014s (~)0.910s103.34x
🌐 MongoDBNext.js (Turbopack)0.110s (-12.9% 🟢)1.014s (~)0.904s103.52x
🐘 PostgresNitro0.201s (-11.7% 🟢)1.027s (+0.7%)0.827s106.43x
🐘 PostgresNext.js (Turbopack)0.247s (+11.7% 🔺)1.020s (~)0.773s107.92x
🐘 PostgresExpress0.380s (+28.2% 🔺)1.013s (~)0.633s1012.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.569s (-3.6%)1.560s (-2.5%)0.991s101.00x
▲ VercelNext.js (Turbopack)0.588s (-7.3% 🟢)1.642s (+10.5% 🔺)1.054s101.03x
▲ VercelNitro0.649s (+29.2% 🔺)1.603s (+6.1% 🔺)0.954s101.14x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.078s (-3.2%)2.005s (~)0.927s101.00x
🌐 RedisNext.js (Turbopack)1.082s (-1.6%)2.015s (~)0.933s101.00x
💻 LocalNext.js (Turbopack)1.095s (~)2.011s (~)0.917s101.02x
🌐 StarterNext.js (Turbopack)1.095s (~)2.009s (~)0.915s101.02x
💻 LocalExpress1.112s (~)2.006s (~)0.894s101.03x
🌐 TursoNext.js (Turbopack)1.306s (~)2.013s (~)0.706s101.21x
🌐 MongoDBNext.js (Turbopack)1.311s (~)2.013s (~)0.702s101.22x
🐘 PostgresNext.js (Turbopack)1.817s (-4.5%)2.015s (~)0.198s101.69x
🐘 PostgresExpress2.237s (+5.4% 🔺)3.015s (~)0.778s102.08x
🐘 PostgresNitro2.450s (+7.3% 🔺)3.014s (~)0.565s102.27x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.680s (~)3.564s (-1.5%)0.884s101.00x
▲ VercelNext.js (Turbopack)2.720s (-1.7%)3.807s (+3.9%)1.087s101.01x
▲ VercelExpress2.915s (-9.0% 🟢)3.798s (-8.9% 🟢)0.883s101.09x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.530s (-2.3%)11.011s (~)0.481s51.00x
🌐 RedisNext.js (Turbopack)10.592s (~)11.024s (~)0.432s51.01x
🌐 StarterNext.js (Turbopack)10.593s (~)11.010s (~)0.418s51.01x
💻 LocalNext.js (Turbopack)10.655s (~)11.016s (~)0.361s51.01x
💻 LocalExpress10.788s (~)11.013s (~)0.225s51.02x
🌐 TursoNext.js (Turbopack)12.184s (~)13.021s (~)0.837s51.16x
🌐 MongoDBNext.js (Turbopack)12.220s (~)13.021s (~)0.801s51.16x
🐘 PostgresNext.js (Turbopack)15.222s (+1.1%)16.037s (+2.6%)0.816s51.45x
🐘 PostgresExpress16.138s (-21.1% 🟢)16.831s (-20.0% 🟢)0.693s51.53x
🐘 PostgresNitro20.335s (~)21.039s (~)0.704s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.391s (+1.5%)22.091s (~)0.700s51.00x
▲ VercelNext.js (Turbopack)21.549s (+0.8%)22.240s (~)0.691s51.01x
▲ VercelNitro22.032s (~)22.680s (-1.1%)0.647s51.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.329s (-5.3% 🟢)2.006s (~)0.678s151.00x
🌐 StarterNext.js (Turbopack)1.344s (~)2.009s (~)0.665s151.01x
🌐 RedisNext.js (Turbopack)1.356s (~)2.012s (~)0.656s151.02x
💻 LocalNext.js (Turbopack)1.381s (-0.9%)2.012s (~)0.631s151.04x
💻 LocalExpress1.418s (~)2.007s (~)0.588s151.07x
🐘 PostgresNext.js (Turbopack)1.988s (-8.4% 🟢)2.325s (-3.1%)0.337s131.50x
🐘 PostgresExpress2.003s (-13.8% 🟢)2.225s (-26.2% 🟢)0.222s141.51x
🌐 MongoDBNext.js (Turbopack)2.135s (~)3.011s (~)0.876s101.61x
🌐 TursoNext.js (Turbopack)2.208s (~)3.013s (~)0.805s101.66x
🐘 PostgresNitro2.661s (+11.4% 🔺)3.013s (~)0.352s102.00x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.801s (-25.1% 🟢)3.588s (-22.2% 🟢)0.787s91.00x
▲ VercelExpress2.944s (-3.6%)3.818s (-3.8%)0.873s81.05x
▲ VercelNext.js (Turbopack)3.151s (+12.6% 🔺)3.923s (-0.7%)0.772s81.13x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.981s (-8.7% 🟢)2.159s (-29.1% 🟢)0.178s141.00x
💻 LocalNext.js (Turbopack)2.095s (-3.8%)2.945s (-5.8% 🟢)0.850s111.06x
💻 LocalExpress2.197s (-1.5%)3.124s (-1.4%)0.927s101.11x
🌐 RedisNext.js (Turbopack)2.401s (-0.5%)3.017s (~)0.615s101.21x
🌐 StarterNext.js (Turbopack)2.464s (+0.7%)3.009s (~)0.545s101.24x
🐘 PostgresNext.js (Turbopack)2.640s (-4.0%)3.017s (~)0.378s101.33x
🐘 PostgresExpress2.890s (-7.1% 🟢)3.011s (-20.3% 🟢)0.122s101.46x
🐘 PostgresNitro2.996s (-10.3% 🟢)3.361s (-16.6% 🟢)0.365s91.51x
🌐 TursoNext.js (Turbopack)4.685s (-1.3%)5.179s (~)0.494s62.37x
🌐 MongoDBNext.js (Turbopack)4.787s (+0.6%)5.179s (~)0.392s62.42x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.254s (-2.0%)3.847s (-2.0%)0.593s81.00x
▲ VercelExpress3.540s (-6.3% 🟢)4.122s (-13.6% 🟢)0.582s81.09x
▲ VercelNext.js (Turbopack)3.618s (-4.7%)4.338s (~)0.720s81.11x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.340s (-4.2%)2.006s (~)0.665s151.00x
💻 LocalNext.js (Turbopack)1.367s (-2.7%)2.011s (~)0.644s151.02x
🌐 StarterNext.js (Turbopack)1.371s (+1.6%)2.007s (~)0.636s151.02x
🌐 RedisNext.js (Turbopack)1.377s (-0.7%)2.012s (~)0.635s151.03x
💻 LocalExpress1.414s (-1.3%)2.005s (~)0.592s151.05x
🐘 PostgresExpress1.642s (-9.9% 🟢)2.010s (-6.7% 🟢)0.368s151.23x
🐘 PostgresNext.js (Turbopack)1.825s (-8.4% 🟢)2.012s (-7.1% 🟢)0.187s151.36x
🐘 PostgresNitro1.904s (+3.9%)2.237s (+3.9%)0.333s141.42x
🌐 MongoDBNext.js (Turbopack)2.147s (~)3.014s (~)0.867s101.60x
🌐 TursoNext.js (Turbopack)2.214s (-0.9%)3.011s (~)0.796s101.65x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.627s (-13.8% 🟢)3.680s (-6.5% 🟢)1.053s91.00x
▲ VercelNext.js (Turbopack)2.740s (-1.5%)3.778s (+5.5% 🔺)1.038s81.04x
▲ VercelNitro2.823s (-1.4%)3.686s (-3.7%)0.863s91.07x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro2.150s (-2.5%)3.035s (-3.4%)0.885s101.00x
💻 LocalNext.js (Turbopack)2.159s (-6.8% 🟢)3.125s (-4.3%)0.966s101.00x
💻 LocalExpress2.269s (-3.4%)3.198s (-2.3%)0.929s101.06x
🌐 RedisNext.js (Turbopack)2.375s (-1.7%)3.013s (~)0.638s101.10x
🌐 StarterNext.js (Turbopack)2.454s (~)3.010s (~)0.556s101.14x
🐘 PostgresExpress2.621s (-1.2%)3.023s (~)0.402s101.22x
🐘 PostgresNext.js (Turbopack)2.637s (+2.4%)3.021s (~)0.385s101.23x
🐘 PostgresNitro2.771s (~)3.011s (-3.7%)0.241s101.29x
🌐 TursoNext.js (Turbopack)4.748s (+0.9%)5.186s (~)0.438s62.21x
🌐 MongoDBNext.js (Turbopack)4.783s (~)5.179s (~)0.396s62.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.099s (+0.9%)3.810s (+3.2%)0.711s81.00x
▲ VercelNitro3.130s (+6.4% 🔺)3.720s (+2.8%)0.590s91.01x
▲ VercelNext.js (Turbopack)3.139s (-3.5%)3.719s (~)0.580s91.01x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.117s (-32.0% 🟢)0.999s (~)0.014s (-13.9% 🟢)1.020s (~)0.903s101.00x
🌐 RedisNext.js (Turbopack)0.121s (-9.6% 🟢)1.005s (~)0.000s (~)1.017s (~)0.896s101.03x
🌐 StarterNext.js (Turbopack)0.126s (-3.5%)1.005s (~)0.000s (-100.0% 🟢)1.011s (~)0.884s101.08x
💻 LocalNext.js (Turbopack)0.138s (-1.4%)1.003s (~)0.017s (-1.2%)1.028s (~)0.890s101.18x
💻 LocalExpress0.173s (-2.5%)0.993s (~)0.015s (+4.1%)1.022s (~)0.849s101.47x
🌐 MongoDBNext.js (Turbopack)0.480s (~)0.968s (~)0.000s (-100.0% 🟢)1.012s (~)0.533s104.09x
🌐 TursoNext.js (Turbopack)0.503s (+1.7%)0.949s (-0.6%)0.000s (-100.0% 🟢)1.014s (~)0.510s104.29x
🐘 PostgresNext.js (Turbopack)1.212s (+12.5% 🔺)1.831s (-7.2% 🟢)0.000s (NaN%)2.017s (~)0.805s1010.33x
🐘 PostgresExpress1.431s (-36.2% 🟢)1.655s (-40.9% 🟢)0.000s (-66.7% 🟢)2.014s (-33.2% 🟢)0.583s1012.20x
🐘 PostgresNitro2.153s (-2.2%)2.892s (+1.7%)0.000s (NaN%)3.016s (~)0.863s1018.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.581s (-6.5% 🟢)3.256s (-0.9%)0.907s (+151.4% 🔺)4.588s (+13.4% 🔺)2.007s101.00x
▲ VercelExpress2.700s (+4.6%)3.253s (-3.2%)0.934s (+100.7% 🔺)4.707s (+10.2% 🔺)2.007s101.05x
▲ VercelNitro2.805s (+11.1% 🔺)3.149s (+8.5% 🔺)0.876s (+32.8% 🔺)4.533s (+14.4% 🔺)1.727s101.09x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro8/8
🐘 PostgresNext.js (Turbopack)5/8
▲ VercelExpress4/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Redis3/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

I, Chris Tate <chris@ctate.dev>, hereby add my Signed-off-by to this commit: f41c090
Signed-off-by: Chris Tate <chris@ctate.dev>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive AI SDK parity features to the DurableAgent class, significantly expanding its capabilities to match the AI SDK's streamText functionality while maintaining workflow durability guarantees.

Key Changes:

  • Added generation settings support (temperature, maxOutputTokens, topP, topK, penalties, seed, etc.) at both constructor and per-stream levels
  • Implemented step control via maxSteps (defaults to unlimited for backwards compatibility), toolChoice, and activeTools filtering
  • Added lifecycle callbacks: onChunk, onStepFinish, onFinish, onError, and onAbort
  • Implemented structured output parsing via experimental_output with Output.object()
  • Added experimental context passing, telemetry, tool call repair, and stream transforms

Reviewed changes

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

Show a summary per file
FileDescription
packages/ai/src/index.tsExports DurableAgent, Output helper, and all new types for public API
packages/ai/src/agent/durable-agent.tsMain implementation: adds type definitions, enhances DurableAgent class with generation settings, callbacks, structured output, and tool filtering
packages/ai/src/agent/stream-text-iterator.tsImplements maxSteps limiting, abort signal handling, prepareStep enhancements for all generation settings, and callback integration
packages/ai/src/agent/do-stream-step.tsHandles generation settings application to model calls, implements transforms, onChunk callback, and enables file/source/tool-input streaming
packages/ai/src/agent/durable-agent.test.tsComprehensive test coverage for all new features including generation settings, maxSteps, toolChoice, activeTools, callbacks, context, and repair functions
docs/content/docs/api-reference/workflow-ai/durable-agent.mdxExtensive documentation with examples for all new features

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

Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/do-stream-step.ts Outdated
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/do-stream-step.ts
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threaddocs/content/docs/api-reference/workflow-ai/durable-agent.mdx Outdated
Comment thread.changeset/quiet-ears-punch.md Outdated
Comment thread.changeset/quiet-ears-punch.md Outdated
ctateand others added 3 commits December 22, 2025 18:43
Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Nathan Rajlich <n@n8.io>
Comment threadpackages/ai/src/agent/durable-agent.ts
const controller = new AbortController();

// Set a timeout to abort after 30 seconds
setTimeout(() => controller.abort(), 30000);

@pranaygppranaygpDec 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this doesn't work. You can't use setTimeout in the workflow context since it makes things non-deterministic. calling setTimeout will throw

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I took out the example

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.

5 participants

@ctate@avi1989@TooTallNate@pranaygp
, '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

ai sdk parity for DurableAgent - #668

Merged
pranaygp merged 15 commits into
mainfrom
ctate/da-parity
Dec 24, 2025
Merged

ai sdk parity for DurableAgent#668
pranaygp merged 15 commits into
mainfrom
ctate/da-parity

Conversation

@ctate

@ctatectate commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

Key Changes

Generation Settings

  • Support for temperature, maxOutputTokens, topP, topK, presencePenalty, frequencyPenalty, stopSequences, seed at constructor and per-stream level

Step Control

  • Added maxSteps to limit LLM calls (default: unlimited for backwards compatibility)
  • Added toolChoice (auto, none, required, or specific tool)
  • Added activeTools to filter available tools per-stream call

Callbacks

  • onChunk - called for each stream chunk
  • onStepFinish - called after each step completes
  • onFinish - called when all steps complete
  • onError - called on errors
  • onAbort - called when aborted via AbortSignal

Structured Output

  • Added experimental_output with Output.object({ schema }) for parsing structured responses

Context & Telemetry

  • Added experimental_context to pass data to tool executions
  • Added experimental_telemetry for observability

Stream Result

  • stream() now returns { messages, steps, experimental_output } instead of just { messages }

Other

  • prepareStep can now override generation settings, toolChoice, and context
  • Added experimental_repairToolCall for handling malformed tool calls
  • Enabled file, source, and tool input streaming chunks
  • Exported all new types from @workflow/ai

@vercel

vercelBot commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Dec 21, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0c0dfe1

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 21, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production286011297
❌ 💻 Local Development236268270
✅ 📦 Local Production26208270
✅ 🐘 Local Postgres26208270
❌ 🪟 Windows027027
❌ 🌍 Community Worlds58620120
Total1104115351254

❌ Failed Tests

💻 Local Development (26 failed)

nuxt-stable (26 failed):

  • addTenWorkflow
  • addTenWorkflow
  • 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
🪟 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 (62 failed)

mongodb (1 failed):

  • webhookWorkflow

redis (1 failed):

  • webhookWorkflow

starter-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

starter (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

turso-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

turso (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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro2601
✅ example2601
✅ express2601
✅ fastify2601
✅ hono2601
✅ nextjs-turbopack2601
✅ nextjs-webpack2601
✅ nitro2601
✅ nuxt2601
✅ sveltekit2601
✅ vite2601
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
❌ nuxt-stable0261
✅ 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-dev300
❌ mongodb2610
✅ redis-dev300
❌ redis2610
❌ starter-dev030
❌ starter0270
❌ turso-dev030
❌ turso0270

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Dec 21, 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
💻 Local🥇 Nitro0.031s (-26.1% 🟢)1.007s (~)0.975s101.00x
🌐 StarterNext.js (Turbopack)0.036s (-8.7% 🟢)1.014s (~)0.978s101.15x
🌐 RedisNext.js (Turbopack)0.037s (-8.2% 🟢)1.018s (~)0.982s101.18x
💻 LocalNext.js (Turbopack)0.038s (-4.5%)1.018s (~)0.980s101.21x
💻 LocalExpress0.042s (-5.8% 🟢)1.007s (~)0.965s101.35x
🌐 TursoNext.js (Turbopack)0.104s (-3.3%)1.014s (~)0.910s103.34x
🌐 MongoDBNext.js (Turbopack)0.110s (-12.9% 🟢)1.014s (~)0.904s103.52x
🐘 PostgresNitro0.201s (-11.7% 🟢)1.027s (+0.7%)0.827s106.43x
🐘 PostgresNext.js (Turbopack)0.247s (+11.7% 🔺)1.020s (~)0.773s107.92x
🐘 PostgresExpress0.380s (+28.2% 🔺)1.013s (~)0.633s1012.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.569s (-3.6%)1.560s (-2.5%)0.991s101.00x
▲ VercelNext.js (Turbopack)0.588s (-7.3% 🟢)1.642s (+10.5% 🔺)1.054s101.03x
▲ VercelNitro0.649s (+29.2% 🔺)1.603s (+6.1% 🔺)0.954s101.14x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.078s (-3.2%)2.005s (~)0.927s101.00x
🌐 RedisNext.js (Turbopack)1.082s (-1.6%)2.015s (~)0.933s101.00x
💻 LocalNext.js (Turbopack)1.095s (~)2.011s (~)0.917s101.02x
🌐 StarterNext.js (Turbopack)1.095s (~)2.009s (~)0.915s101.02x
💻 LocalExpress1.112s (~)2.006s (~)0.894s101.03x
🌐 TursoNext.js (Turbopack)1.306s (~)2.013s (~)0.706s101.21x
🌐 MongoDBNext.js (Turbopack)1.311s (~)2.013s (~)0.702s101.22x
🐘 PostgresNext.js (Turbopack)1.817s (-4.5%)2.015s (~)0.198s101.69x
🐘 PostgresExpress2.237s (+5.4% 🔺)3.015s (~)0.778s102.08x
🐘 PostgresNitro2.450s (+7.3% 🔺)3.014s (~)0.565s102.27x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.680s (~)3.564s (-1.5%)0.884s101.00x
▲ VercelNext.js (Turbopack)2.720s (-1.7%)3.807s (+3.9%)1.087s101.01x
▲ VercelExpress2.915s (-9.0% 🟢)3.798s (-8.9% 🟢)0.883s101.09x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.530s (-2.3%)11.011s (~)0.481s51.00x
🌐 RedisNext.js (Turbopack)10.592s (~)11.024s (~)0.432s51.01x
🌐 StarterNext.js (Turbopack)10.593s (~)11.010s (~)0.418s51.01x
💻 LocalNext.js (Turbopack)10.655s (~)11.016s (~)0.361s51.01x
💻 LocalExpress10.788s (~)11.013s (~)0.225s51.02x
🌐 TursoNext.js (Turbopack)12.184s (~)13.021s (~)0.837s51.16x
🌐 MongoDBNext.js (Turbopack)12.220s (~)13.021s (~)0.801s51.16x
🐘 PostgresNext.js (Turbopack)15.222s (+1.1%)16.037s (+2.6%)0.816s51.45x
🐘 PostgresExpress16.138s (-21.1% 🟢)16.831s (-20.0% 🟢)0.693s51.53x
🐘 PostgresNitro20.335s (~)21.039s (~)0.704s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.391s (+1.5%)22.091s (~)0.700s51.00x
▲ VercelNext.js (Turbopack)21.549s (+0.8%)22.240s (~)0.691s51.01x
▲ VercelNitro22.032s (~)22.680s (-1.1%)0.647s51.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.329s (-5.3% 🟢)2.006s (~)0.678s151.00x
🌐 StarterNext.js (Turbopack)1.344s (~)2.009s (~)0.665s151.01x
🌐 RedisNext.js (Turbopack)1.356s (~)2.012s (~)0.656s151.02x
💻 LocalNext.js (Turbopack)1.381s (-0.9%)2.012s (~)0.631s151.04x
💻 LocalExpress1.418s (~)2.007s (~)0.588s151.07x
🐘 PostgresNext.js (Turbopack)1.988s (-8.4% 🟢)2.325s (-3.1%)0.337s131.50x
🐘 PostgresExpress2.003s (-13.8% 🟢)2.225s (-26.2% 🟢)0.222s141.51x
🌐 MongoDBNext.js (Turbopack)2.135s (~)3.011s (~)0.876s101.61x
🌐 TursoNext.js (Turbopack)2.208s (~)3.013s (~)0.805s101.66x
🐘 PostgresNitro2.661s (+11.4% 🔺)3.013s (~)0.352s102.00x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.801s (-25.1% 🟢)3.588s (-22.2% 🟢)0.787s91.00x
▲ VercelExpress2.944s (-3.6%)3.818s (-3.8%)0.873s81.05x
▲ VercelNext.js (Turbopack)3.151s (+12.6% 🔺)3.923s (-0.7%)0.772s81.13x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.981s (-8.7% 🟢)2.159s (-29.1% 🟢)0.178s141.00x
💻 LocalNext.js (Turbopack)2.095s (-3.8%)2.945s (-5.8% 🟢)0.850s111.06x
💻 LocalExpress2.197s (-1.5%)3.124s (-1.4%)0.927s101.11x
🌐 RedisNext.js (Turbopack)2.401s (-0.5%)3.017s (~)0.615s101.21x
🌐 StarterNext.js (Turbopack)2.464s (+0.7%)3.009s (~)0.545s101.24x
🐘 PostgresNext.js (Turbopack)2.640s (-4.0%)3.017s (~)0.378s101.33x
🐘 PostgresExpress2.890s (-7.1% 🟢)3.011s (-20.3% 🟢)0.122s101.46x
🐘 PostgresNitro2.996s (-10.3% 🟢)3.361s (-16.6% 🟢)0.365s91.51x
🌐 TursoNext.js (Turbopack)4.685s (-1.3%)5.179s (~)0.494s62.37x
🌐 MongoDBNext.js (Turbopack)4.787s (+0.6%)5.179s (~)0.392s62.42x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.254s (-2.0%)3.847s (-2.0%)0.593s81.00x
▲ VercelExpress3.540s (-6.3% 🟢)4.122s (-13.6% 🟢)0.582s81.09x
▲ VercelNext.js (Turbopack)3.618s (-4.7%)4.338s (~)0.720s81.11x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.340s (-4.2%)2.006s (~)0.665s151.00x
💻 LocalNext.js (Turbopack)1.367s (-2.7%)2.011s (~)0.644s151.02x
🌐 StarterNext.js (Turbopack)1.371s (+1.6%)2.007s (~)0.636s151.02x
🌐 RedisNext.js (Turbopack)1.377s (-0.7%)2.012s (~)0.635s151.03x
💻 LocalExpress1.414s (-1.3%)2.005s (~)0.592s151.05x
🐘 PostgresExpress1.642s (-9.9% 🟢)2.010s (-6.7% 🟢)0.368s151.23x
🐘 PostgresNext.js (Turbopack)1.825s (-8.4% 🟢)2.012s (-7.1% 🟢)0.187s151.36x
🐘 PostgresNitro1.904s (+3.9%)2.237s (+3.9%)0.333s141.42x
🌐 MongoDBNext.js (Turbopack)2.147s (~)3.014s (~)0.867s101.60x
🌐 TursoNext.js (Turbopack)2.214s (-0.9%)3.011s (~)0.796s101.65x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.627s (-13.8% 🟢)3.680s (-6.5% 🟢)1.053s91.00x
▲ VercelNext.js (Turbopack)2.740s (-1.5%)3.778s (+5.5% 🔺)1.038s81.04x
▲ VercelNitro2.823s (-1.4%)3.686s (-3.7%)0.863s91.07x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro2.150s (-2.5%)3.035s (-3.4%)0.885s101.00x
💻 LocalNext.js (Turbopack)2.159s (-6.8% 🟢)3.125s (-4.3%)0.966s101.00x
💻 LocalExpress2.269s (-3.4%)3.198s (-2.3%)0.929s101.06x
🌐 RedisNext.js (Turbopack)2.375s (-1.7%)3.013s (~)0.638s101.10x
🌐 StarterNext.js (Turbopack)2.454s (~)3.010s (~)0.556s101.14x
🐘 PostgresExpress2.621s (-1.2%)3.023s (~)0.402s101.22x
🐘 PostgresNext.js (Turbopack)2.637s (+2.4%)3.021s (~)0.385s101.23x
🐘 PostgresNitro2.771s (~)3.011s (-3.7%)0.241s101.29x
🌐 TursoNext.js (Turbopack)4.748s (+0.9%)5.186s (~)0.438s62.21x
🌐 MongoDBNext.js (Turbopack)4.783s (~)5.179s (~)0.396s62.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.099s (+0.9%)3.810s (+3.2%)0.711s81.00x
▲ VercelNitro3.130s (+6.4% 🔺)3.720s (+2.8%)0.590s91.01x
▲ VercelNext.js (Turbopack)3.139s (-3.5%)3.719s (~)0.580s91.01x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.117s (-32.0% 🟢)0.999s (~)0.014s (-13.9% 🟢)1.020s (~)0.903s101.00x
🌐 RedisNext.js (Turbopack)0.121s (-9.6% 🟢)1.005s (~)0.000s (~)1.017s (~)0.896s101.03x
🌐 StarterNext.js (Turbopack)0.126s (-3.5%)1.005s (~)0.000s (-100.0% 🟢)1.011s (~)0.884s101.08x
💻 LocalNext.js (Turbopack)0.138s (-1.4%)1.003s (~)0.017s (-1.2%)1.028s (~)0.890s101.18x
💻 LocalExpress0.173s (-2.5%)0.993s (~)0.015s (+4.1%)1.022s (~)0.849s101.47x
🌐 MongoDBNext.js (Turbopack)0.480s (~)0.968s (~)0.000s (-100.0% 🟢)1.012s (~)0.533s104.09x
🌐 TursoNext.js (Turbopack)0.503s (+1.7%)0.949s (-0.6%)0.000s (-100.0% 🟢)1.014s (~)0.510s104.29x
🐘 PostgresNext.js (Turbopack)1.212s (+12.5% 🔺)1.831s (-7.2% 🟢)0.000s (NaN%)2.017s (~)0.805s1010.33x
🐘 PostgresExpress1.431s (-36.2% 🟢)1.655s (-40.9% 🟢)0.000s (-66.7% 🟢)2.014s (-33.2% 🟢)0.583s1012.20x
🐘 PostgresNitro2.153s (-2.2%)2.892s (+1.7%)0.000s (NaN%)3.016s (~)0.863s1018.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.581s (-6.5% 🟢)3.256s (-0.9%)0.907s (+151.4% 🔺)4.588s (+13.4% 🔺)2.007s101.00x
▲ VercelExpress2.700s (+4.6%)3.253s (-3.2%)0.934s (+100.7% 🔺)4.707s (+10.2% 🔺)2.007s101.05x
▲ VercelNitro2.805s (+11.1% 🔺)3.149s (+8.5% 🔺)0.876s (+32.8% 🔺)4.533s (+14.4% 🔺)1.727s101.09x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro8/8
🐘 PostgresNext.js (Turbopack)5/8
▲ VercelExpress4/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Redis3/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

I, Chris Tate <chris@ctate.dev>, hereby add my Signed-off-by to this commit: f41c090
Signed-off-by: Chris Tate <chris@ctate.dev>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive AI SDK parity features to the DurableAgent class, significantly expanding its capabilities to match the AI SDK's streamText functionality while maintaining workflow durability guarantees.

Key Changes:

  • Added generation settings support (temperature, maxOutputTokens, topP, topK, penalties, seed, etc.) at both constructor and per-stream levels
  • Implemented step control via maxSteps (defaults to unlimited for backwards compatibility), toolChoice, and activeTools filtering
  • Added lifecycle callbacks: onChunk, onStepFinish, onFinish, onError, and onAbort
  • Implemented structured output parsing via experimental_output with Output.object()
  • Added experimental context passing, telemetry, tool call repair, and stream transforms

Reviewed changes

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

Show a summary per file
FileDescription
packages/ai/src/index.tsExports DurableAgent, Output helper, and all new types for public API
packages/ai/src/agent/durable-agent.tsMain implementation: adds type definitions, enhances DurableAgent class with generation settings, callbacks, structured output, and tool filtering
packages/ai/src/agent/stream-text-iterator.tsImplements maxSteps limiting, abort signal handling, prepareStep enhancements for all generation settings, and callback integration
packages/ai/src/agent/do-stream-step.tsHandles generation settings application to model calls, implements transforms, onChunk callback, and enables file/source/tool-input streaming
packages/ai/src/agent/durable-agent.test.tsComprehensive test coverage for all new features including generation settings, maxSteps, toolChoice, activeTools, callbacks, context, and repair functions
docs/content/docs/api-reference/workflow-ai/durable-agent.mdxExtensive documentation with examples for all new features

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

Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/do-stream-step.ts Outdated
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/do-stream-step.ts
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threaddocs/content/docs/api-reference/workflow-ai/durable-agent.mdx Outdated
Comment thread.changeset/quiet-ears-punch.md Outdated
Comment thread.changeset/quiet-ears-punch.md Outdated
ctateand others added 3 commits December 22, 2025 18:43
Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Nathan Rajlich <n@n8.io>
Comment threadpackages/ai/src/agent/durable-agent.ts
const controller = new AbortController();

// Set a timeout to abort after 30 seconds
setTimeout(() => controller.abort(), 30000);

@pranaygppranaygpDec 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this doesn't work. You can't use setTimeout in the workflow context since it makes things non-deterministic. calling setTimeout will throw

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I took out the example

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.

5 participants

@ctate@avi1989@TooTallNate@pranaygp
, '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

ai sdk parity for DurableAgent - #668

Merged
pranaygp merged 15 commits into
mainfrom
ctate/da-parity
Dec 24, 2025
Merged

ai sdk parity for DurableAgent#668
pranaygp merged 15 commits into
mainfrom
ctate/da-parity

Conversation

@ctate

@ctatectate commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

Key Changes

Generation Settings

  • Support for temperature, maxOutputTokens, topP, topK, presencePenalty, frequencyPenalty, stopSequences, seed at constructor and per-stream level

Step Control

  • Added maxSteps to limit LLM calls (default: unlimited for backwards compatibility)
  • Added toolChoice (auto, none, required, or specific tool)
  • Added activeTools to filter available tools per-stream call

Callbacks

  • onChunk - called for each stream chunk
  • onStepFinish - called after each step completes
  • onFinish - called when all steps complete
  • onError - called on errors
  • onAbort - called when aborted via AbortSignal

Structured Output

  • Added experimental_output with Output.object({ schema }) for parsing structured responses

Context & Telemetry

  • Added experimental_context to pass data to tool executions
  • Added experimental_telemetry for observability

Stream Result

  • stream() now returns { messages, steps, experimental_output } instead of just { messages }

Other

  • prepareStep can now override generation settings, toolChoice, and context
  • Added experimental_repairToolCall for handling malformed tool calls
  • Enabled file, source, and tool input streaming chunks
  • Exported all new types from @workflow/ai

@vercel

vercelBot commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Dec 21, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0c0dfe1

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 21, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production286011297
❌ 💻 Local Development236268270
✅ 📦 Local Production26208270
✅ 🐘 Local Postgres26208270
❌ 🪟 Windows027027
❌ 🌍 Community Worlds58620120
Total1104115351254

❌ Failed Tests

💻 Local Development (26 failed)

nuxt-stable (26 failed):

  • addTenWorkflow
  • addTenWorkflow
  • 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
🪟 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 (62 failed)

mongodb (1 failed):

  • webhookWorkflow

redis (1 failed):

  • webhookWorkflow

starter-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

starter (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

turso-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

turso (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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro2601
✅ example2601
✅ express2601
✅ fastify2601
✅ hono2601
✅ nextjs-turbopack2601
✅ nextjs-webpack2601
✅ nitro2601
✅ nuxt2601
✅ sveltekit2601
✅ vite2601
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
❌ nuxt-stable0261
✅ 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-dev300
❌ mongodb2610
✅ redis-dev300
❌ redis2610
❌ starter-dev030
❌ starter0270
❌ turso-dev030
❌ turso0270

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Dec 21, 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
💻 Local🥇 Nitro0.031s (-26.1% 🟢)1.007s (~)0.975s101.00x
🌐 StarterNext.js (Turbopack)0.036s (-8.7% 🟢)1.014s (~)0.978s101.15x
🌐 RedisNext.js (Turbopack)0.037s (-8.2% 🟢)1.018s (~)0.982s101.18x
💻 LocalNext.js (Turbopack)0.038s (-4.5%)1.018s (~)0.980s101.21x
💻 LocalExpress0.042s (-5.8% 🟢)1.007s (~)0.965s101.35x
🌐 TursoNext.js (Turbopack)0.104s (-3.3%)1.014s (~)0.910s103.34x
🌐 MongoDBNext.js (Turbopack)0.110s (-12.9% 🟢)1.014s (~)0.904s103.52x
🐘 PostgresNitro0.201s (-11.7% 🟢)1.027s (+0.7%)0.827s106.43x
🐘 PostgresNext.js (Turbopack)0.247s (+11.7% 🔺)1.020s (~)0.773s107.92x
🐘 PostgresExpress0.380s (+28.2% 🔺)1.013s (~)0.633s1012.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.569s (-3.6%)1.560s (-2.5%)0.991s101.00x
▲ VercelNext.js (Turbopack)0.588s (-7.3% 🟢)1.642s (+10.5% 🔺)1.054s101.03x
▲ VercelNitro0.649s (+29.2% 🔺)1.603s (+6.1% 🔺)0.954s101.14x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.078s (-3.2%)2.005s (~)0.927s101.00x
🌐 RedisNext.js (Turbopack)1.082s (-1.6%)2.015s (~)0.933s101.00x
💻 LocalNext.js (Turbopack)1.095s (~)2.011s (~)0.917s101.02x
🌐 StarterNext.js (Turbopack)1.095s (~)2.009s (~)0.915s101.02x
💻 LocalExpress1.112s (~)2.006s (~)0.894s101.03x
🌐 TursoNext.js (Turbopack)1.306s (~)2.013s (~)0.706s101.21x
🌐 MongoDBNext.js (Turbopack)1.311s (~)2.013s (~)0.702s101.22x
🐘 PostgresNext.js (Turbopack)1.817s (-4.5%)2.015s (~)0.198s101.69x
🐘 PostgresExpress2.237s (+5.4% 🔺)3.015s (~)0.778s102.08x
🐘 PostgresNitro2.450s (+7.3% 🔺)3.014s (~)0.565s102.27x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.680s (~)3.564s (-1.5%)0.884s101.00x
▲ VercelNext.js (Turbopack)2.720s (-1.7%)3.807s (+3.9%)1.087s101.01x
▲ VercelExpress2.915s (-9.0% 🟢)3.798s (-8.9% 🟢)0.883s101.09x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.530s (-2.3%)11.011s (~)0.481s51.00x
🌐 RedisNext.js (Turbopack)10.592s (~)11.024s (~)0.432s51.01x
🌐 StarterNext.js (Turbopack)10.593s (~)11.010s (~)0.418s51.01x
💻 LocalNext.js (Turbopack)10.655s (~)11.016s (~)0.361s51.01x
💻 LocalExpress10.788s (~)11.013s (~)0.225s51.02x
🌐 TursoNext.js (Turbopack)12.184s (~)13.021s (~)0.837s51.16x
🌐 MongoDBNext.js (Turbopack)12.220s (~)13.021s (~)0.801s51.16x
🐘 PostgresNext.js (Turbopack)15.222s (+1.1%)16.037s (+2.6%)0.816s51.45x
🐘 PostgresExpress16.138s (-21.1% 🟢)16.831s (-20.0% 🟢)0.693s51.53x
🐘 PostgresNitro20.335s (~)21.039s (~)0.704s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.391s (+1.5%)22.091s (~)0.700s51.00x
▲ VercelNext.js (Turbopack)21.549s (+0.8%)22.240s (~)0.691s51.01x
▲ VercelNitro22.032s (~)22.680s (-1.1%)0.647s51.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.329s (-5.3% 🟢)2.006s (~)0.678s151.00x
🌐 StarterNext.js (Turbopack)1.344s (~)2.009s (~)0.665s151.01x
🌐 RedisNext.js (Turbopack)1.356s (~)2.012s (~)0.656s151.02x
💻 LocalNext.js (Turbopack)1.381s (-0.9%)2.012s (~)0.631s151.04x
💻 LocalExpress1.418s (~)2.007s (~)0.588s151.07x
🐘 PostgresNext.js (Turbopack)1.988s (-8.4% 🟢)2.325s (-3.1%)0.337s131.50x
🐘 PostgresExpress2.003s (-13.8% 🟢)2.225s (-26.2% 🟢)0.222s141.51x
🌐 MongoDBNext.js (Turbopack)2.135s (~)3.011s (~)0.876s101.61x
🌐 TursoNext.js (Turbopack)2.208s (~)3.013s (~)0.805s101.66x
🐘 PostgresNitro2.661s (+11.4% 🔺)3.013s (~)0.352s102.00x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.801s (-25.1% 🟢)3.588s (-22.2% 🟢)0.787s91.00x
▲ VercelExpress2.944s (-3.6%)3.818s (-3.8%)0.873s81.05x
▲ VercelNext.js (Turbopack)3.151s (+12.6% 🔺)3.923s (-0.7%)0.772s81.13x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.981s (-8.7% 🟢)2.159s (-29.1% 🟢)0.178s141.00x
💻 LocalNext.js (Turbopack)2.095s (-3.8%)2.945s (-5.8% 🟢)0.850s111.06x
💻 LocalExpress2.197s (-1.5%)3.124s (-1.4%)0.927s101.11x
🌐 RedisNext.js (Turbopack)2.401s (-0.5%)3.017s (~)0.615s101.21x
🌐 StarterNext.js (Turbopack)2.464s (+0.7%)3.009s (~)0.545s101.24x
🐘 PostgresNext.js (Turbopack)2.640s (-4.0%)3.017s (~)0.378s101.33x
🐘 PostgresExpress2.890s (-7.1% 🟢)3.011s (-20.3% 🟢)0.122s101.46x
🐘 PostgresNitro2.996s (-10.3% 🟢)3.361s (-16.6% 🟢)0.365s91.51x
🌐 TursoNext.js (Turbopack)4.685s (-1.3%)5.179s (~)0.494s62.37x
🌐 MongoDBNext.js (Turbopack)4.787s (+0.6%)5.179s (~)0.392s62.42x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.254s (-2.0%)3.847s (-2.0%)0.593s81.00x
▲ VercelExpress3.540s (-6.3% 🟢)4.122s (-13.6% 🟢)0.582s81.09x
▲ VercelNext.js (Turbopack)3.618s (-4.7%)4.338s (~)0.720s81.11x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.340s (-4.2%)2.006s (~)0.665s151.00x
💻 LocalNext.js (Turbopack)1.367s (-2.7%)2.011s (~)0.644s151.02x
🌐 StarterNext.js (Turbopack)1.371s (+1.6%)2.007s (~)0.636s151.02x
🌐 RedisNext.js (Turbopack)1.377s (-0.7%)2.012s (~)0.635s151.03x
💻 LocalExpress1.414s (-1.3%)2.005s (~)0.592s151.05x
🐘 PostgresExpress1.642s (-9.9% 🟢)2.010s (-6.7% 🟢)0.368s151.23x
🐘 PostgresNext.js (Turbopack)1.825s (-8.4% 🟢)2.012s (-7.1% 🟢)0.187s151.36x
🐘 PostgresNitro1.904s (+3.9%)2.237s (+3.9%)0.333s141.42x
🌐 MongoDBNext.js (Turbopack)2.147s (~)3.014s (~)0.867s101.60x
🌐 TursoNext.js (Turbopack)2.214s (-0.9%)3.011s (~)0.796s101.65x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.627s (-13.8% 🟢)3.680s (-6.5% 🟢)1.053s91.00x
▲ VercelNext.js (Turbopack)2.740s (-1.5%)3.778s (+5.5% 🔺)1.038s81.04x
▲ VercelNitro2.823s (-1.4%)3.686s (-3.7%)0.863s91.07x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro2.150s (-2.5%)3.035s (-3.4%)0.885s101.00x
💻 LocalNext.js (Turbopack)2.159s (-6.8% 🟢)3.125s (-4.3%)0.966s101.00x
💻 LocalExpress2.269s (-3.4%)3.198s (-2.3%)0.929s101.06x
🌐 RedisNext.js (Turbopack)2.375s (-1.7%)3.013s (~)0.638s101.10x
🌐 StarterNext.js (Turbopack)2.454s (~)3.010s (~)0.556s101.14x
🐘 PostgresExpress2.621s (-1.2%)3.023s (~)0.402s101.22x
🐘 PostgresNext.js (Turbopack)2.637s (+2.4%)3.021s (~)0.385s101.23x
🐘 PostgresNitro2.771s (~)3.011s (-3.7%)0.241s101.29x
🌐 TursoNext.js (Turbopack)4.748s (+0.9%)5.186s (~)0.438s62.21x
🌐 MongoDBNext.js (Turbopack)4.783s (~)5.179s (~)0.396s62.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.099s (+0.9%)3.810s (+3.2%)0.711s81.00x
▲ VercelNitro3.130s (+6.4% 🔺)3.720s (+2.8%)0.590s91.01x
▲ VercelNext.js (Turbopack)3.139s (-3.5%)3.719s (~)0.580s91.01x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.117s (-32.0% 🟢)0.999s (~)0.014s (-13.9% 🟢)1.020s (~)0.903s101.00x
🌐 RedisNext.js (Turbopack)0.121s (-9.6% 🟢)1.005s (~)0.000s (~)1.017s (~)0.896s101.03x
🌐 StarterNext.js (Turbopack)0.126s (-3.5%)1.005s (~)0.000s (-100.0% 🟢)1.011s (~)0.884s101.08x
💻 LocalNext.js (Turbopack)0.138s (-1.4%)1.003s (~)0.017s (-1.2%)1.028s (~)0.890s101.18x
💻 LocalExpress0.173s (-2.5%)0.993s (~)0.015s (+4.1%)1.022s (~)0.849s101.47x
🌐 MongoDBNext.js (Turbopack)0.480s (~)0.968s (~)0.000s (-100.0% 🟢)1.012s (~)0.533s104.09x
🌐 TursoNext.js (Turbopack)0.503s (+1.7%)0.949s (-0.6%)0.000s (-100.0% 🟢)1.014s (~)0.510s104.29x
🐘 PostgresNext.js (Turbopack)1.212s (+12.5% 🔺)1.831s (-7.2% 🟢)0.000s (NaN%)2.017s (~)0.805s1010.33x
🐘 PostgresExpress1.431s (-36.2% 🟢)1.655s (-40.9% 🟢)0.000s (-66.7% 🟢)2.014s (-33.2% 🟢)0.583s1012.20x
🐘 PostgresNitro2.153s (-2.2%)2.892s (+1.7%)0.000s (NaN%)3.016s (~)0.863s1018.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.581s (-6.5% 🟢)3.256s (-0.9%)0.907s (+151.4% 🔺)4.588s (+13.4% 🔺)2.007s101.00x
▲ VercelExpress2.700s (+4.6%)3.253s (-3.2%)0.934s (+100.7% 🔺)4.707s (+10.2% 🔺)2.007s101.05x
▲ VercelNitro2.805s (+11.1% 🔺)3.149s (+8.5% 🔺)0.876s (+32.8% 🔺)4.533s (+14.4% 🔺)1.727s101.09x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro8/8
🐘 PostgresNext.js (Turbopack)5/8
▲ VercelExpress4/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Redis3/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

I, Chris Tate <chris@ctate.dev>, hereby add my Signed-off-by to this commit: f41c090
Signed-off-by: Chris Tate <chris@ctate.dev>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive AI SDK parity features to the DurableAgent class, significantly expanding its capabilities to match the AI SDK's streamText functionality while maintaining workflow durability guarantees.

Key Changes:

  • Added generation settings support (temperature, maxOutputTokens, topP, topK, penalties, seed, etc.) at both constructor and per-stream levels
  • Implemented step control via maxSteps (defaults to unlimited for backwards compatibility), toolChoice, and activeTools filtering
  • Added lifecycle callbacks: onChunk, onStepFinish, onFinish, onError, and onAbort
  • Implemented structured output parsing via experimental_output with Output.object()
  • Added experimental context passing, telemetry, tool call repair, and stream transforms

Reviewed changes

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

Show a summary per file
FileDescription
packages/ai/src/index.tsExports DurableAgent, Output helper, and all new types for public API
packages/ai/src/agent/durable-agent.tsMain implementation: adds type definitions, enhances DurableAgent class with generation settings, callbacks, structured output, and tool filtering
packages/ai/src/agent/stream-text-iterator.tsImplements maxSteps limiting, abort signal handling, prepareStep enhancements for all generation settings, and callback integration
packages/ai/src/agent/do-stream-step.tsHandles generation settings application to model calls, implements transforms, onChunk callback, and enables file/source/tool-input streaming
packages/ai/src/agent/durable-agent.test.tsComprehensive test coverage for all new features including generation settings, maxSteps, toolChoice, activeTools, callbacks, context, and repair functions
docs/content/docs/api-reference/workflow-ai/durable-agent.mdxExtensive documentation with examples for all new features

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

Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/do-stream-step.ts Outdated
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/do-stream-step.ts
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threaddocs/content/docs/api-reference/workflow-ai/durable-agent.mdx Outdated
Comment thread.changeset/quiet-ears-punch.md Outdated
Comment thread.changeset/quiet-ears-punch.md Outdated
ctateand others added 3 commits December 22, 2025 18:43
Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Nathan Rajlich <n@n8.io>
Comment threadpackages/ai/src/agent/durable-agent.ts
const controller = new AbortController();

// Set a timeout to abort after 30 seconds
setTimeout(() => controller.abort(), 30000);

@pranaygppranaygpDec 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this doesn't work. You can't use setTimeout in the workflow context since it makes things non-deterministic. calling setTimeout will throw

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I took out the example

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.

5 participants

@ctate@avi1989@TooTallNate@pranaygp
, '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

ai sdk parity for DurableAgent - #668

Merged
pranaygp merged 15 commits into
mainfrom
ctate/da-parity
Dec 24, 2025
Merged

ai sdk parity for DurableAgent#668
pranaygp merged 15 commits into
mainfrom
ctate/da-parity

Conversation

@ctate

@ctatectate commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

Key Changes

Generation Settings

  • Support for temperature, maxOutputTokens, topP, topK, presencePenalty, frequencyPenalty, stopSequences, seed at constructor and per-stream level

Step Control

  • Added maxSteps to limit LLM calls (default: unlimited for backwards compatibility)
  • Added toolChoice (auto, none, required, or specific tool)
  • Added activeTools to filter available tools per-stream call

Callbacks

  • onChunk - called for each stream chunk
  • onStepFinish - called after each step completes
  • onFinish - called when all steps complete
  • onError - called on errors
  • onAbort - called when aborted via AbortSignal

Structured Output

  • Added experimental_output with Output.object({ schema }) for parsing structured responses

Context & Telemetry

  • Added experimental_context to pass data to tool executions
  • Added experimental_telemetry for observability

Stream Result

  • stream() now returns { messages, steps, experimental_output } instead of just { messages }

Other

  • prepareStep can now override generation settings, toolChoice, and context
  • Added experimental_repairToolCall for handling malformed tool calls
  • Enabled file, source, and tool input streaming chunks
  • Exported all new types from @workflow/ai

@vercel

vercelBot commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Dec 21, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0c0dfe1

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 21, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production286011297
❌ 💻 Local Development236268270
✅ 📦 Local Production26208270
✅ 🐘 Local Postgres26208270
❌ 🪟 Windows027027
❌ 🌍 Community Worlds58620120
Total1104115351254

❌ Failed Tests

💻 Local Development (26 failed)

nuxt-stable (26 failed):

  • addTenWorkflow
  • addTenWorkflow
  • 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
🪟 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 (62 failed)

mongodb (1 failed):

  • webhookWorkflow

redis (1 failed):

  • webhookWorkflow

starter-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

starter (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

turso-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

turso (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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro2601
✅ example2601
✅ express2601
✅ fastify2601
✅ hono2601
✅ nextjs-turbopack2601
✅ nextjs-webpack2601
✅ nitro2601
✅ nuxt2601
✅ sveltekit2601
✅ vite2601
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
❌ nuxt-stable0261
✅ 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-dev300
❌ mongodb2610
✅ redis-dev300
❌ redis2610
❌ starter-dev030
❌ starter0270
❌ turso-dev030
❌ turso0270

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Dec 21, 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
💻 Local🥇 Nitro0.031s (-26.1% 🟢)1.007s (~)0.975s101.00x
🌐 StarterNext.js (Turbopack)0.036s (-8.7% 🟢)1.014s (~)0.978s101.15x
🌐 RedisNext.js (Turbopack)0.037s (-8.2% 🟢)1.018s (~)0.982s101.18x
💻 LocalNext.js (Turbopack)0.038s (-4.5%)1.018s (~)0.980s101.21x
💻 LocalExpress0.042s (-5.8% 🟢)1.007s (~)0.965s101.35x
🌐 TursoNext.js (Turbopack)0.104s (-3.3%)1.014s (~)0.910s103.34x
🌐 MongoDBNext.js (Turbopack)0.110s (-12.9% 🟢)1.014s (~)0.904s103.52x
🐘 PostgresNitro0.201s (-11.7% 🟢)1.027s (+0.7%)0.827s106.43x
🐘 PostgresNext.js (Turbopack)0.247s (+11.7% 🔺)1.020s (~)0.773s107.92x
🐘 PostgresExpress0.380s (+28.2% 🔺)1.013s (~)0.633s1012.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.569s (-3.6%)1.560s (-2.5%)0.991s101.00x
▲ VercelNext.js (Turbopack)0.588s (-7.3% 🟢)1.642s (+10.5% 🔺)1.054s101.03x
▲ VercelNitro0.649s (+29.2% 🔺)1.603s (+6.1% 🔺)0.954s101.14x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.078s (-3.2%)2.005s (~)0.927s101.00x
🌐 RedisNext.js (Turbopack)1.082s (-1.6%)2.015s (~)0.933s101.00x
💻 LocalNext.js (Turbopack)1.095s (~)2.011s (~)0.917s101.02x
🌐 StarterNext.js (Turbopack)1.095s (~)2.009s (~)0.915s101.02x
💻 LocalExpress1.112s (~)2.006s (~)0.894s101.03x
🌐 TursoNext.js (Turbopack)1.306s (~)2.013s (~)0.706s101.21x
🌐 MongoDBNext.js (Turbopack)1.311s (~)2.013s (~)0.702s101.22x
🐘 PostgresNext.js (Turbopack)1.817s (-4.5%)2.015s (~)0.198s101.69x
🐘 PostgresExpress2.237s (+5.4% 🔺)3.015s (~)0.778s102.08x
🐘 PostgresNitro2.450s (+7.3% 🔺)3.014s (~)0.565s102.27x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.680s (~)3.564s (-1.5%)0.884s101.00x
▲ VercelNext.js (Turbopack)2.720s (-1.7%)3.807s (+3.9%)1.087s101.01x
▲ VercelExpress2.915s (-9.0% 🟢)3.798s (-8.9% 🟢)0.883s101.09x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.530s (-2.3%)11.011s (~)0.481s51.00x
🌐 RedisNext.js (Turbopack)10.592s (~)11.024s (~)0.432s51.01x
🌐 StarterNext.js (Turbopack)10.593s (~)11.010s (~)0.418s51.01x
💻 LocalNext.js (Turbopack)10.655s (~)11.016s (~)0.361s51.01x
💻 LocalExpress10.788s (~)11.013s (~)0.225s51.02x
🌐 TursoNext.js (Turbopack)12.184s (~)13.021s (~)0.837s51.16x
🌐 MongoDBNext.js (Turbopack)12.220s (~)13.021s (~)0.801s51.16x
🐘 PostgresNext.js (Turbopack)15.222s (+1.1%)16.037s (+2.6%)0.816s51.45x
🐘 PostgresExpress16.138s (-21.1% 🟢)16.831s (-20.0% 🟢)0.693s51.53x
🐘 PostgresNitro20.335s (~)21.039s (~)0.704s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.391s (+1.5%)22.091s (~)0.700s51.00x
▲ VercelNext.js (Turbopack)21.549s (+0.8%)22.240s (~)0.691s51.01x
▲ VercelNitro22.032s (~)22.680s (-1.1%)0.647s51.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.329s (-5.3% 🟢)2.006s (~)0.678s151.00x
🌐 StarterNext.js (Turbopack)1.344s (~)2.009s (~)0.665s151.01x
🌐 RedisNext.js (Turbopack)1.356s (~)2.012s (~)0.656s151.02x
💻 LocalNext.js (Turbopack)1.381s (-0.9%)2.012s (~)0.631s151.04x
💻 LocalExpress1.418s (~)2.007s (~)0.588s151.07x
🐘 PostgresNext.js (Turbopack)1.988s (-8.4% 🟢)2.325s (-3.1%)0.337s131.50x
🐘 PostgresExpress2.003s (-13.8% 🟢)2.225s (-26.2% 🟢)0.222s141.51x
🌐 MongoDBNext.js (Turbopack)2.135s (~)3.011s (~)0.876s101.61x
🌐 TursoNext.js (Turbopack)2.208s (~)3.013s (~)0.805s101.66x
🐘 PostgresNitro2.661s (+11.4% 🔺)3.013s (~)0.352s102.00x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.801s (-25.1% 🟢)3.588s (-22.2% 🟢)0.787s91.00x
▲ VercelExpress2.944s (-3.6%)3.818s (-3.8%)0.873s81.05x
▲ VercelNext.js (Turbopack)3.151s (+12.6% 🔺)3.923s (-0.7%)0.772s81.13x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.981s (-8.7% 🟢)2.159s (-29.1% 🟢)0.178s141.00x
💻 LocalNext.js (Turbopack)2.095s (-3.8%)2.945s (-5.8% 🟢)0.850s111.06x
💻 LocalExpress2.197s (-1.5%)3.124s (-1.4%)0.927s101.11x
🌐 RedisNext.js (Turbopack)2.401s (-0.5%)3.017s (~)0.615s101.21x
🌐 StarterNext.js (Turbopack)2.464s (+0.7%)3.009s (~)0.545s101.24x
🐘 PostgresNext.js (Turbopack)2.640s (-4.0%)3.017s (~)0.378s101.33x
🐘 PostgresExpress2.890s (-7.1% 🟢)3.011s (-20.3% 🟢)0.122s101.46x
🐘 PostgresNitro2.996s (-10.3% 🟢)3.361s (-16.6% 🟢)0.365s91.51x
🌐 TursoNext.js (Turbopack)4.685s (-1.3%)5.179s (~)0.494s62.37x
🌐 MongoDBNext.js (Turbopack)4.787s (+0.6%)5.179s (~)0.392s62.42x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.254s (-2.0%)3.847s (-2.0%)0.593s81.00x
▲ VercelExpress3.540s (-6.3% 🟢)4.122s (-13.6% 🟢)0.582s81.09x
▲ VercelNext.js (Turbopack)3.618s (-4.7%)4.338s (~)0.720s81.11x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.340s (-4.2%)2.006s (~)0.665s151.00x
💻 LocalNext.js (Turbopack)1.367s (-2.7%)2.011s (~)0.644s151.02x
🌐 StarterNext.js (Turbopack)1.371s (+1.6%)2.007s (~)0.636s151.02x
🌐 RedisNext.js (Turbopack)1.377s (-0.7%)2.012s (~)0.635s151.03x
💻 LocalExpress1.414s (-1.3%)2.005s (~)0.592s151.05x
🐘 PostgresExpress1.642s (-9.9% 🟢)2.010s (-6.7% 🟢)0.368s151.23x
🐘 PostgresNext.js (Turbopack)1.825s (-8.4% 🟢)2.012s (-7.1% 🟢)0.187s151.36x
🐘 PostgresNitro1.904s (+3.9%)2.237s (+3.9%)0.333s141.42x
🌐 MongoDBNext.js (Turbopack)2.147s (~)3.014s (~)0.867s101.60x
🌐 TursoNext.js (Turbopack)2.214s (-0.9%)3.011s (~)0.796s101.65x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.627s (-13.8% 🟢)3.680s (-6.5% 🟢)1.053s91.00x
▲ VercelNext.js (Turbopack)2.740s (-1.5%)3.778s (+5.5% 🔺)1.038s81.04x
▲ VercelNitro2.823s (-1.4%)3.686s (-3.7%)0.863s91.07x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro2.150s (-2.5%)3.035s (-3.4%)0.885s101.00x
💻 LocalNext.js (Turbopack)2.159s (-6.8% 🟢)3.125s (-4.3%)0.966s101.00x
💻 LocalExpress2.269s (-3.4%)3.198s (-2.3%)0.929s101.06x
🌐 RedisNext.js (Turbopack)2.375s (-1.7%)3.013s (~)0.638s101.10x
🌐 StarterNext.js (Turbopack)2.454s (~)3.010s (~)0.556s101.14x
🐘 PostgresExpress2.621s (-1.2%)3.023s (~)0.402s101.22x
🐘 PostgresNext.js (Turbopack)2.637s (+2.4%)3.021s (~)0.385s101.23x
🐘 PostgresNitro2.771s (~)3.011s (-3.7%)0.241s101.29x
🌐 TursoNext.js (Turbopack)4.748s (+0.9%)5.186s (~)0.438s62.21x
🌐 MongoDBNext.js (Turbopack)4.783s (~)5.179s (~)0.396s62.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.099s (+0.9%)3.810s (+3.2%)0.711s81.00x
▲ VercelNitro3.130s (+6.4% 🔺)3.720s (+2.8%)0.590s91.01x
▲ VercelNext.js (Turbopack)3.139s (-3.5%)3.719s (~)0.580s91.01x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.117s (-32.0% 🟢)0.999s (~)0.014s (-13.9% 🟢)1.020s (~)0.903s101.00x
🌐 RedisNext.js (Turbopack)0.121s (-9.6% 🟢)1.005s (~)0.000s (~)1.017s (~)0.896s101.03x
🌐 StarterNext.js (Turbopack)0.126s (-3.5%)1.005s (~)0.000s (-100.0% 🟢)1.011s (~)0.884s101.08x
💻 LocalNext.js (Turbopack)0.138s (-1.4%)1.003s (~)0.017s (-1.2%)1.028s (~)0.890s101.18x
💻 LocalExpress0.173s (-2.5%)0.993s (~)0.015s (+4.1%)1.022s (~)0.849s101.47x
🌐 MongoDBNext.js (Turbopack)0.480s (~)0.968s (~)0.000s (-100.0% 🟢)1.012s (~)0.533s104.09x
🌐 TursoNext.js (Turbopack)0.503s (+1.7%)0.949s (-0.6%)0.000s (-100.0% 🟢)1.014s (~)0.510s104.29x
🐘 PostgresNext.js (Turbopack)1.212s (+12.5% 🔺)1.831s (-7.2% 🟢)0.000s (NaN%)2.017s (~)0.805s1010.33x
🐘 PostgresExpress1.431s (-36.2% 🟢)1.655s (-40.9% 🟢)0.000s (-66.7% 🟢)2.014s (-33.2% 🟢)0.583s1012.20x
🐘 PostgresNitro2.153s (-2.2%)2.892s (+1.7%)0.000s (NaN%)3.016s (~)0.863s1018.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.581s (-6.5% 🟢)3.256s (-0.9%)0.907s (+151.4% 🔺)4.588s (+13.4% 🔺)2.007s101.00x
▲ VercelExpress2.700s (+4.6%)3.253s (-3.2%)0.934s (+100.7% 🔺)4.707s (+10.2% 🔺)2.007s101.05x
▲ VercelNitro2.805s (+11.1% 🔺)3.149s (+8.5% 🔺)0.876s (+32.8% 🔺)4.533s (+14.4% 🔺)1.727s101.09x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro8/8
🐘 PostgresNext.js (Turbopack)5/8
▲ VercelExpress4/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Redis3/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

I, Chris Tate <chris@ctate.dev>, hereby add my Signed-off-by to this commit: f41c090
Signed-off-by: Chris Tate <chris@ctate.dev>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive AI SDK parity features to the DurableAgent class, significantly expanding its capabilities to match the AI SDK's streamText functionality while maintaining workflow durability guarantees.

Key Changes:

  • Added generation settings support (temperature, maxOutputTokens, topP, topK, penalties, seed, etc.) at both constructor and per-stream levels
  • Implemented step control via maxSteps (defaults to unlimited for backwards compatibility), toolChoice, and activeTools filtering
  • Added lifecycle callbacks: onChunk, onStepFinish, onFinish, onError, and onAbort
  • Implemented structured output parsing via experimental_output with Output.object()
  • Added experimental context passing, telemetry, tool call repair, and stream transforms

Reviewed changes

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

Show a summary per file
FileDescription
packages/ai/src/index.tsExports DurableAgent, Output helper, and all new types for public API
packages/ai/src/agent/durable-agent.tsMain implementation: adds type definitions, enhances DurableAgent class with generation settings, callbacks, structured output, and tool filtering
packages/ai/src/agent/stream-text-iterator.tsImplements maxSteps limiting, abort signal handling, prepareStep enhancements for all generation settings, and callback integration
packages/ai/src/agent/do-stream-step.tsHandles generation settings application to model calls, implements transforms, onChunk callback, and enables file/source/tool-input streaming
packages/ai/src/agent/durable-agent.test.tsComprehensive test coverage for all new features including generation settings, maxSteps, toolChoice, activeTools, callbacks, context, and repair functions
docs/content/docs/api-reference/workflow-ai/durable-agent.mdxExtensive documentation with examples for all new features

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

Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/do-stream-step.ts Outdated
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/do-stream-step.ts
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threaddocs/content/docs/api-reference/workflow-ai/durable-agent.mdx Outdated
Comment thread.changeset/quiet-ears-punch.md Outdated
Comment thread.changeset/quiet-ears-punch.md Outdated
ctateand others added 3 commits December 22, 2025 18:43
Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Nathan Rajlich <n@n8.io>
Comment threadpackages/ai/src/agent/durable-agent.ts
const controller = new AbortController();

// Set a timeout to abort after 30 seconds
setTimeout(() => controller.abort(), 30000);

@pranaygppranaygpDec 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this doesn't work. You can't use setTimeout in the workflow context since it makes things non-deterministic. calling setTimeout will throw

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I took out the example

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.

5 participants

@ctate@avi1989@TooTallNate@pranaygp
, '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

ai sdk parity for DurableAgent - #668

Merged
pranaygp merged 15 commits into
mainfrom
ctate/da-parity
Dec 24, 2025
Merged

ai sdk parity for DurableAgent#668
pranaygp merged 15 commits into
mainfrom
ctate/da-parity

Conversation

@ctate

@ctatectate commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

Key Changes

Generation Settings

  • Support for temperature, maxOutputTokens, topP, topK, presencePenalty, frequencyPenalty, stopSequences, seed at constructor and per-stream level

Step Control

  • Added maxSteps to limit LLM calls (default: unlimited for backwards compatibility)
  • Added toolChoice (auto, none, required, or specific tool)
  • Added activeTools to filter available tools per-stream call

Callbacks

  • onChunk - called for each stream chunk
  • onStepFinish - called after each step completes
  • onFinish - called when all steps complete
  • onError - called on errors
  • onAbort - called when aborted via AbortSignal

Structured Output

  • Added experimental_output with Output.object({ schema }) for parsing structured responses

Context & Telemetry

  • Added experimental_context to pass data to tool executions
  • Added experimental_telemetry for observability

Stream Result

  • stream() now returns { messages, steps, experimental_output } instead of just { messages }

Other

  • prepareStep can now override generation settings, toolChoice, and context
  • Added experimental_repairToolCall for handling malformed tool calls
  • Enabled file, source, and tool input streaming chunks
  • Exported all new types from @workflow/ai

@vercel

vercelBot commented Dec 21, 2025

Copy link
Copy Markdown
Contributor

@changeset-bot

changeset-botBot commented Dec 21, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0c0dfe1

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 21, 2025

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production286011297
❌ 💻 Local Development236268270
✅ 📦 Local Production26208270
✅ 🐘 Local Postgres26208270
❌ 🪟 Windows027027
❌ 🌍 Community Worlds58620120
Total1104115351254

❌ Failed Tests

💻 Local Development (26 failed)

nuxt-stable (26 failed):

  • addTenWorkflow
  • addTenWorkflow
  • 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
🪟 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 (62 failed)

mongodb (1 failed):

  • webhookWorkflow

redis (1 failed):

  • webhookWorkflow

starter-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

starter (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

turso-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

turso (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

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro2601
✅ example2601
✅ express2601
✅ fastify2601
✅ hono2601
✅ nextjs-turbopack2601
✅ nextjs-webpack2601
✅ nitro2601
✅ nuxt2601
✅ sveltekit2601
✅ vite2601
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable2601
✅ express-stable2601
✅ fastify-stable2601
✅ hono-stable2601
✅ nextjs-turbopack-stable2700
✅ nextjs-webpack-stable2700
✅ nitro-stable2601
❌ nuxt-stable0261
✅ 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-dev300
❌ mongodb2610
✅ redis-dev300
❌ redis2610
❌ starter-dev030
❌ starter0270
❌ turso-dev030
❌ turso0270

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Dec 21, 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
💻 Local🥇 Nitro0.031s (-26.1% 🟢)1.007s (~)0.975s101.00x
🌐 StarterNext.js (Turbopack)0.036s (-8.7% 🟢)1.014s (~)0.978s101.15x
🌐 RedisNext.js (Turbopack)0.037s (-8.2% 🟢)1.018s (~)0.982s101.18x
💻 LocalNext.js (Turbopack)0.038s (-4.5%)1.018s (~)0.980s101.21x
💻 LocalExpress0.042s (-5.8% 🟢)1.007s (~)0.965s101.35x
🌐 TursoNext.js (Turbopack)0.104s (-3.3%)1.014s (~)0.910s103.34x
🌐 MongoDBNext.js (Turbopack)0.110s (-12.9% 🟢)1.014s (~)0.904s103.52x
🐘 PostgresNitro0.201s (-11.7% 🟢)1.027s (+0.7%)0.827s106.43x
🐘 PostgresNext.js (Turbopack)0.247s (+11.7% 🔺)1.020s (~)0.773s107.92x
🐘 PostgresExpress0.380s (+28.2% 🔺)1.013s (~)0.633s1012.19x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.569s (-3.6%)1.560s (-2.5%)0.991s101.00x
▲ VercelNext.js (Turbopack)0.588s (-7.3% 🟢)1.642s (+10.5% 🔺)1.054s101.03x
▲ VercelNitro0.649s (+29.2% 🔺)1.603s (+6.1% 🔺)0.954s101.14x

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

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.078s (-3.2%)2.005s (~)0.927s101.00x
🌐 RedisNext.js (Turbopack)1.082s (-1.6%)2.015s (~)0.933s101.00x
💻 LocalNext.js (Turbopack)1.095s (~)2.011s (~)0.917s101.02x
🌐 StarterNext.js (Turbopack)1.095s (~)2.009s (~)0.915s101.02x
💻 LocalExpress1.112s (~)2.006s (~)0.894s101.03x
🌐 TursoNext.js (Turbopack)1.306s (~)2.013s (~)0.706s101.21x
🌐 MongoDBNext.js (Turbopack)1.311s (~)2.013s (~)0.702s101.22x
🐘 PostgresNext.js (Turbopack)1.817s (-4.5%)2.015s (~)0.198s101.69x
🐘 PostgresExpress2.237s (+5.4% 🔺)3.015s (~)0.778s102.08x
🐘 PostgresNitro2.450s (+7.3% 🔺)3.014s (~)0.565s102.27x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.680s (~)3.564s (-1.5%)0.884s101.00x
▲ VercelNext.js (Turbopack)2.720s (-1.7%)3.807s (+3.9%)1.087s101.01x
▲ VercelExpress2.915s (-9.0% 🟢)3.798s (-8.9% 🟢)0.883s101.09x

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

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro10.530s (-2.3%)11.011s (~)0.481s51.00x
🌐 RedisNext.js (Turbopack)10.592s (~)11.024s (~)0.432s51.01x
🌐 StarterNext.js (Turbopack)10.593s (~)11.010s (~)0.418s51.01x
💻 LocalNext.js (Turbopack)10.655s (~)11.016s (~)0.361s51.01x
💻 LocalExpress10.788s (~)11.013s (~)0.225s51.02x
🌐 TursoNext.js (Turbopack)12.184s (~)13.021s (~)0.837s51.16x
🌐 MongoDBNext.js (Turbopack)12.220s (~)13.021s (~)0.801s51.16x
🐘 PostgresNext.js (Turbopack)15.222s (+1.1%)16.037s (+2.6%)0.816s51.45x
🐘 PostgresExpress16.138s (-21.1% 🟢)16.831s (-20.0% 🟢)0.693s51.53x
🐘 PostgresNitro20.335s (~)21.039s (~)0.704s51.93x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express21.391s (+1.5%)22.091s (~)0.700s51.00x
▲ VercelNext.js (Turbopack)21.549s (+0.8%)22.240s (~)0.691s51.01x
▲ VercelNitro22.032s (~)22.680s (-1.1%)0.647s51.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.329s (-5.3% 🟢)2.006s (~)0.678s151.00x
🌐 StarterNext.js (Turbopack)1.344s (~)2.009s (~)0.665s151.01x
🌐 RedisNext.js (Turbopack)1.356s (~)2.012s (~)0.656s151.02x
💻 LocalNext.js (Turbopack)1.381s (-0.9%)2.012s (~)0.631s151.04x
💻 LocalExpress1.418s (~)2.007s (~)0.588s151.07x
🐘 PostgresNext.js (Turbopack)1.988s (-8.4% 🟢)2.325s (-3.1%)0.337s131.50x
🐘 PostgresExpress2.003s (-13.8% 🟢)2.225s (-26.2% 🟢)0.222s141.51x
🌐 MongoDBNext.js (Turbopack)2.135s (~)3.011s (~)0.876s101.61x
🌐 TursoNext.js (Turbopack)2.208s (~)3.013s (~)0.805s101.66x
🐘 PostgresNitro2.661s (+11.4% 🔺)3.013s (~)0.352s102.00x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.801s (-25.1% 🟢)3.588s (-22.2% 🟢)0.787s91.00x
▲ VercelExpress2.944s (-3.6%)3.818s (-3.8%)0.873s81.05x
▲ VercelNext.js (Turbopack)3.151s (+12.6% 🔺)3.923s (-0.7%)0.772s81.13x

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

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.981s (-8.7% 🟢)2.159s (-29.1% 🟢)0.178s141.00x
💻 LocalNext.js (Turbopack)2.095s (-3.8%)2.945s (-5.8% 🟢)0.850s111.06x
💻 LocalExpress2.197s (-1.5%)3.124s (-1.4%)0.927s101.11x
🌐 RedisNext.js (Turbopack)2.401s (-0.5%)3.017s (~)0.615s101.21x
🌐 StarterNext.js (Turbopack)2.464s (+0.7%)3.009s (~)0.545s101.24x
🐘 PostgresNext.js (Turbopack)2.640s (-4.0%)3.017s (~)0.378s101.33x
🐘 PostgresExpress2.890s (-7.1% 🟢)3.011s (-20.3% 🟢)0.122s101.46x
🐘 PostgresNitro2.996s (-10.3% 🟢)3.361s (-16.6% 🟢)0.365s91.51x
🌐 TursoNext.js (Turbopack)4.685s (-1.3%)5.179s (~)0.494s62.37x
🌐 MongoDBNext.js (Turbopack)4.787s (+0.6%)5.179s (~)0.392s62.42x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.254s (-2.0%)3.847s (-2.0%)0.593s81.00x
▲ VercelExpress3.540s (-6.3% 🟢)4.122s (-13.6% 🟢)0.582s81.09x
▲ VercelNext.js (Turbopack)3.618s (-4.7%)4.338s (~)0.720s81.11x

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

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro1.340s (-4.2%)2.006s (~)0.665s151.00x
💻 LocalNext.js (Turbopack)1.367s (-2.7%)2.011s (~)0.644s151.02x
🌐 StarterNext.js (Turbopack)1.371s (+1.6%)2.007s (~)0.636s151.02x
🌐 RedisNext.js (Turbopack)1.377s (-0.7%)2.012s (~)0.635s151.03x
💻 LocalExpress1.414s (-1.3%)2.005s (~)0.592s151.05x
🐘 PostgresExpress1.642s (-9.9% 🟢)2.010s (-6.7% 🟢)0.368s151.23x
🐘 PostgresNext.js (Turbopack)1.825s (-8.4% 🟢)2.012s (-7.1% 🟢)0.187s151.36x
🐘 PostgresNitro1.904s (+3.9%)2.237s (+3.9%)0.333s141.42x
🌐 MongoDBNext.js (Turbopack)2.147s (~)3.014s (~)0.867s101.60x
🌐 TursoNext.js (Turbopack)2.214s (-0.9%)3.011s (~)0.796s101.65x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.627s (-13.8% 🟢)3.680s (-6.5% 🟢)1.053s91.00x
▲ VercelNext.js (Turbopack)2.740s (-1.5%)3.778s (+5.5% 🔺)1.038s81.04x
▲ VercelNitro2.823s (-1.4%)3.686s (-3.7%)0.863s91.07x

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

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro2.150s (-2.5%)3.035s (-3.4%)0.885s101.00x
💻 LocalNext.js (Turbopack)2.159s (-6.8% 🟢)3.125s (-4.3%)0.966s101.00x
💻 LocalExpress2.269s (-3.4%)3.198s (-2.3%)0.929s101.06x
🌐 RedisNext.js (Turbopack)2.375s (-1.7%)3.013s (~)0.638s101.10x
🌐 StarterNext.js (Turbopack)2.454s (~)3.010s (~)0.556s101.14x
🐘 PostgresExpress2.621s (-1.2%)3.023s (~)0.402s101.22x
🐘 PostgresNext.js (Turbopack)2.637s (+2.4%)3.021s (~)0.385s101.23x
🐘 PostgresNitro2.771s (~)3.011s (-3.7%)0.241s101.29x
🌐 TursoNext.js (Turbopack)4.748s (+0.9%)5.186s (~)0.438s62.21x
🌐 MongoDBNext.js (Turbopack)4.783s (~)5.179s (~)0.396s62.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.099s (+0.9%)3.810s (+3.2%)0.711s81.00x
▲ VercelNitro3.130s (+6.4% 🔺)3.720s (+2.8%)0.590s91.01x
▲ VercelNext.js (Turbopack)3.139s (-3.5%)3.719s (~)0.580s91.01x

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

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.117s (-32.0% 🟢)0.999s (~)0.014s (-13.9% 🟢)1.020s (~)0.903s101.00x
🌐 RedisNext.js (Turbopack)0.121s (-9.6% 🟢)1.005s (~)0.000s (~)1.017s (~)0.896s101.03x
🌐 StarterNext.js (Turbopack)0.126s (-3.5%)1.005s (~)0.000s (-100.0% 🟢)1.011s (~)0.884s101.08x
💻 LocalNext.js (Turbopack)0.138s (-1.4%)1.003s (~)0.017s (-1.2%)1.028s (~)0.890s101.18x
💻 LocalExpress0.173s (-2.5%)0.993s (~)0.015s (+4.1%)1.022s (~)0.849s101.47x
🌐 MongoDBNext.js (Turbopack)0.480s (~)0.968s (~)0.000s (-100.0% 🟢)1.012s (~)0.533s104.09x
🌐 TursoNext.js (Turbopack)0.503s (+1.7%)0.949s (-0.6%)0.000s (-100.0% 🟢)1.014s (~)0.510s104.29x
🐘 PostgresNext.js (Turbopack)1.212s (+12.5% 🔺)1.831s (-7.2% 🟢)0.000s (NaN%)2.017s (~)0.805s1010.33x
🐘 PostgresExpress1.431s (-36.2% 🟢)1.655s (-40.9% 🟢)0.000s (-66.7% 🟢)2.014s (-33.2% 🟢)0.583s1012.20x
🐘 PostgresNitro2.153s (-2.2%)2.892s (+1.7%)0.000s (NaN%)3.016s (~)0.863s1018.35x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)2.581s (-6.5% 🟢)3.256s (-0.9%)0.907s (+151.4% 🔺)4.588s (+13.4% 🔺)2.007s101.00x
▲ VercelExpress2.700s (+4.6%)3.253s (-3.2%)0.934s (+100.7% 🔺)4.707s (+10.2% 🔺)2.007s101.05x
▲ VercelNitro2.805s (+11.1% 🔺)3.149s (+8.5% 🔺)0.876s (+32.8% 🔺)4.533s (+14.4% 🔺)1.727s101.09x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNitro8/8
🐘 PostgresNext.js (Turbopack)5/8
▲ VercelExpress4/8
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express💻 Local8/8
Next.js (Turbopack)🌐 Redis3/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

I, Chris Tate <chris@ctate.dev>, hereby add my Signed-off-by to this commit: f41c090
Signed-off-by: Chris Tate <chris@ctate.dev>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive AI SDK parity features to the DurableAgent class, significantly expanding its capabilities to match the AI SDK's streamText functionality while maintaining workflow durability guarantees.

Key Changes:

  • Added generation settings support (temperature, maxOutputTokens, topP, topK, penalties, seed, etc.) at both constructor and per-stream levels
  • Implemented step control via maxSteps (defaults to unlimited for backwards compatibility), toolChoice, and activeTools filtering
  • Added lifecycle callbacks: onChunk, onStepFinish, onFinish, onError, and onAbort
  • Implemented structured output parsing via experimental_output with Output.object()
  • Added experimental context passing, telemetry, tool call repair, and stream transforms

Reviewed changes

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

Show a summary per file
FileDescription
packages/ai/src/index.tsExports DurableAgent, Output helper, and all new types for public API
packages/ai/src/agent/durable-agent.tsMain implementation: adds type definitions, enhances DurableAgent class with generation settings, callbacks, structured output, and tool filtering
packages/ai/src/agent/stream-text-iterator.tsImplements maxSteps limiting, abort signal handling, prepareStep enhancements for all generation settings, and callback integration
packages/ai/src/agent/do-stream-step.tsHandles generation settings application to model calls, implements transforms, onChunk callback, and enables file/source/tool-input streaming
packages/ai/src/agent/durable-agent.test.tsComprehensive test coverage for all new features including generation settings, maxSteps, toolChoice, activeTools, callbacks, context, and repair functions
docs/content/docs/api-reference/workflow-ai/durable-agent.mdxExtensive documentation with examples for all new features

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

Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/do-stream-step.ts Outdated
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/durable-agent.ts
Comment threadpackages/ai/src/agent/do-stream-step.ts
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threadpackages/ai/src/agent/stream-text-iterator.ts Outdated
Comment threaddocs/content/docs/api-reference/workflow-ai/durable-agent.mdx Outdated
Comment thread.changeset/quiet-ears-punch.md Outdated
Comment thread.changeset/quiet-ears-punch.md Outdated
ctateand others added 3 commits December 22, 2025 18:43
Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Nathan Rajlich <n@n8.io>
Comment threadpackages/ai/src/agent/durable-agent.ts
const controller = new AbortController();

// Set a timeout to abort after 30 seconds
setTimeout(() => controller.abort(), 30000);

@pranaygppranaygpDec 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this doesn't work. You can't use setTimeout in the workflow context since it makes things non-deterministic. calling setTimeout will throw

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I took out the example

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.

5 participants

@ctate@avi1989@TooTallNate@pranaygp