Skip to content

Conversation

@VaguelySerious
Copy link
Member

@VaguelySerious VaguelySerious commented Jan 15, 2026

This is a refactor of #768 which moves the accumulation logic to a step. The test harness I was using to test #768 didn't correctly account for the workflow transformation, so collectUiMessages didn't actually work as intended before (also reported in issue #739).

This PR moves the final accumulation call to a "use step" at the end of the agent.stream call. The actual logic still uses AI SDK's readUIMessageStream internally, just like before.

I alternatively considered pre-creating a stream in a setup step, then double piping to that stream, before passing it to the final step that can call readUIMessageStream on it. In a non-workflow world, this would result in a performance improvement (native stream use), but since we are awaiting step boundaries anyway, it would not help in this case, and it would make the content less observable.

I tested this in flight-booking-app. See the final step it makes here that gets the chunks and returns the uiMessages:
image

@changeset-bot
Copy link

changeset-bot bot commented Jan 15, 2026

🦋 Changeset detected

Latest commit: 6d2df7d

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

This PR includes changesets to release 2 packages
Name Type
@workflow/ai Patch
@workflow/docs-typecheck Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Contributor

vercel bot commented Jan 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview, Comment Jan 16, 2026 10:24am
example-nextjs-workflow-webpack Ready Ready Preview, Comment Jan 16, 2026 10:24am
example-workflow Ready Ready Preview, Comment Jan 16, 2026 10:24am
workbench-astro-workflow Ready Ready Preview, Comment Jan 16, 2026 10:24am
workbench-express-workflow Ready Ready Preview, Comment Jan 16, 2026 10:24am
workbench-fastify-workflow Ready Ready Preview, Comment Jan 16, 2026 10:24am
workbench-hono-workflow Ready Ready Preview, Comment Jan 16, 2026 10:24am
workbench-nitro-workflow Ready Ready Preview, Comment Jan 16, 2026 10:24am
workbench-nuxt-workflow Ready Ready Preview, Comment Jan 16, 2026 10:24am
workbench-sveltekit-workflow Ready Ready Preview, Comment Jan 16, 2026 10:24am
workbench-vite-workflow Ready Ready Preview, Comment Jan 16, 2026 10:24am
workflow-docs Ready Ready Preview, Comment Jan 16, 2026 10:24am

@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2026

📊 Benchmark Results

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

workflow with no steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Starter 🥇 Next.js (Turbopack) 0.037s (-5.7% 🟢) 1.016s (~) 0.980s 10 1.00x
💻 Local Next.js (Turbopack) 0.039s (-3.4%) 1.017s (~) 0.978s 10 1.07x
🌐 Redis Next.js (Turbopack) 0.044s (+3.8%) 1.018s (~) 0.975s 10 1.19x
💻 Local Express 0.044s (-0.9%) 1.008s (~) 0.963s 10 1.21x
💻 Local Nitro 0.046s (+4.5%) 1.006s (~) 0.960s 10 1.26x
🌐 Turso Next.js (Turbopack) 0.116s (+8.8% 🔺) 1.015s (~) 0.899s 10 3.17x
🌐 MongoDB Next.js (Turbopack) 0.124s (+117.9% 🔺) 1.014s (~) 0.890s 10 3.40x
🐘 Postgres Next.js (Turbopack) 0.198s (-45.6% 🟢) 1.022s (~) 0.824s 10 5.42x
🐘 Postgres Nitro 0.293s (+8.0% 🔺) 1.018s (+0.5%) 0.725s 10 8.00x
🐘 Postgres Express 0.310s (-2.2%) 1.013s (~) 0.703s 10 8.48x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 0.592s (+3.5%) 1.549s (+7.0% 🔺) 0.957s 10 1.00x
▲ Vercel Nitro 0.611s (+12.0% 🔺) 1.515s (-3.3%) 0.904s 10 1.03x
▲ Vercel Next.js (Turbopack) 0.651s (-5.5% 🟢) 1.605s (-1.0%) 0.954s 10 1.10x

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

workflow with 1 step

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Starter 🥇 Next.js (Turbopack) 1.076s (-1.3%) 2.011s (~) 0.935s 10 1.00x
💻 Local Next.js (Turbopack) 1.099s (~) 2.011s (~) 0.912s 10 1.02x
🌐 Redis Next.js (Turbopack) 1.108s (~) 2.012s (~) 0.904s 10 1.03x
💻 Local Nitro 1.114s (~) 2.007s (~) 0.892s 10 1.04x
💻 Local Express 1.115s (~) 2.007s (~) 0.892s 10 1.04x
🌐 Turso Next.js (Turbopack) 1.303s (~) 2.013s (~) 0.710s 10 1.21x
🌐 MongoDB Next.js (Turbopack) 1.305s (+0.6%) 2.013s (~) 0.708s 10 1.21x
🐘 Postgres Next.js (Turbopack) 1.963s (+12.5% 🔺) 2.423s (+19.9% 🔺) 0.460s 10 1.82x
🐘 Postgres Nitro 2.152s (+1.9%) 3.016s (~) 0.864s 10 2.00x
🐘 Postgres Express 2.159s (+1.3%) 3.014s (~) 0.855s 10 2.01x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 2.790s (-4.4%) 3.689s (-0.5%) 0.899s 10 1.00x
▲ Vercel Express 2.857s (-0.9%) 3.664s (+2.4%) 0.806s 10 1.02x
▲ Vercel Nitro 2.951s (-12.7% 🟢) 3.652s (-12.9% 🟢) 0.701s 10 1.06x

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

workflow with 10 sequential steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Starter 🥇 Next.js (Turbopack) 10.504s (-0.8%) 11.012s (~) 0.509s 5 1.00x
💻 Local Next.js (Turbopack) 10.656s (~) 11.019s (~) 0.363s 5 1.01x
🌐 Redis Next.js (Turbopack) 10.694s (~) 11.016s (~) 0.322s 5 1.02x
💻 Local Express 10.799s (~) 11.014s (~) 0.214s 5 1.03x
💻 Local Nitro 10.805s (~) 11.011s (~) 0.206s 5 1.03x
🌐 Turso Next.js (Turbopack) 12.201s (~) 13.024s (~) 0.823s 5 1.16x
🌐 MongoDB Next.js (Turbopack) 12.268s (~) 13.025s (~) 0.757s 5 1.17x
🐘 Postgres Next.js (Turbopack) 15.245s (~) 16.041s (+1.2%) 0.796s 5 1.45x
🐘 Postgres Express 17.720s (-13.4% 🟢) 18.233s (-13.3% 🟢) 0.512s 5 1.69x
🐘 Postgres Nitro 20.466s (~) 21.034s (~) 0.569s 5 1.95x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 23.479s (+4.1%) 24.205s (+2.3%) 0.726s 5 1.00x
▲ Vercel Express 23.561s (+3.8%) 24.139s (+2.4%) 0.579s 5 1.00x
▲ Vercel Next.js (Turbopack) 24.209s (+1.0%) 24.874s (~) 0.665s 5 1.03x

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

Promise.all with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Starter 🥇 Next.js (Turbopack) 1.345s (~) 2.009s (~) 0.664s 15 1.00x
🌐 Redis Next.js (Turbopack) 1.378s (+1.4%) 2.011s (~) 0.633s 15 1.02x
💻 Local Next.js (Turbopack) 1.388s (~) 2.013s (~) 0.624s 15 1.03x
💻 Local Express 1.410s (+0.6%) 2.007s (~) 0.597s 15 1.05x
💻 Local Nitro 1.419s (+0.7%) 2.006s (~) 0.587s 15 1.05x
🐘 Postgres Express 1.885s (-19.6% 🟢) 2.226s (-26.1% 🟢) 0.340s 14 1.40x
🐘 Postgres Next.js (Turbopack) 1.970s (+0.8%) 2.238s (-3.9%) 0.268s 14 1.46x
🌐 MongoDB Next.js (Turbopack) 2.131s (-1.3%) 3.014s (~) 0.884s 10 1.58x
🌐 Turso Next.js (Turbopack) 2.197s (~) 3.017s (~) 0.819s 10 1.63x
🐘 Postgres Nitro 2.364s (~) 3.012s (~) 0.648s 10 1.76x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Express 2.962s (-6.8% 🟢) 3.639s (-8.3% 🟢) 0.677s 9 1.00x
▲ Vercel Next.js (Turbopack) 2.997s (-12.5% 🟢) 3.759s (-12.4% 🟢) 0.762s 8 1.01x
▲ Vercel Nitro 3.067s (+4.2%) 3.853s (+4.0%) 0.786s 8 1.04x

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

Promise.all with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 2.087s (-5.6% 🟢) 2.956s (-6.6% 🟢) 0.868s 11 1.00x
💻 Local Nitro 2.236s (+0.7%) 3.155s (~) 0.919s 10 1.07x
💻 Local Express 2.254s (+1.1%) 3.198s (+0.7%) 0.944s 10 1.08x
🌐 Starter Next.js (Turbopack) 2.401s (-2.1%) 3.012s (~) 0.611s 10 1.15x
🌐 Redis Next.js (Turbopack) 2.512s (+0.7%) 3.012s (~) 0.501s 10 1.20x
🐘 Postgres Express 2.586s (-16.8% 🟢) 3.020s (-22.8% 🟢) 0.434s 10 1.24x
🐘 Postgres Next.js (Turbopack) 2.616s (-1.6%) 3.034s (~) 0.418s 10 1.25x
🐘 Postgres Nitro 3.281s (+9.7% 🔺) 4.042s (+16.5% 🔺) 0.761s 8 1.57x
🌐 MongoDB Next.js (Turbopack) 4.688s (-1.0%) 5.181s (~) 0.493s 6 2.25x
🌐 Turso Next.js (Turbopack) 4.774s (+2.5%) 5.181s (~) 0.407s 6 2.29x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 4.210s (+14.9% 🔺) 4.836s (+15.9% 🔺) 0.625s 8 1.00x
▲ Vercel Express 4.416s (+26.1% 🔺) 5.221s (+24.4% 🔺) 0.805s 7 1.05x
▲ Vercel Next.js (Turbopack) 4.706s (+38.3% 🔺) 5.719s (+41.2% 🔺) 1.014s 6 1.12x

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

Promise.race with 10 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
🌐 Starter 🥇 Next.js (Turbopack) 1.353s (+1.5%) 2.009s (~) 0.656s 15 1.00x
🌐 Redis Next.js (Turbopack) 1.391s (-0.5%) 2.010s (~) 0.620s 15 1.03x
💻 Local Next.js (Turbopack) 1.394s (-1.2%) 2.014s (~) 0.619s 15 1.03x
💻 Local Nitro 1.425s (~) 2.005s (~) 0.580s 15 1.05x
💻 Local Express 1.438s (~) 2.006s (~) 0.568s 15 1.06x
🐘 Postgres Next.js (Turbopack) 1.694s (~) 2.013s (~) 0.320s 15 1.25x
🐘 Postgres Express 1.739s (-24.5% 🟢) 2.011s (-22.5% 🟢) 0.272s 15 1.28x
🌐 MongoDB Next.js (Turbopack) 2.154s (+1.3%) 3.021s (~) 0.867s 10 1.59x
🌐 Turso Next.js (Turbopack) 2.183s (-2.4%) 3.013s (~) 0.830s 10 1.61x
🐘 Postgres Nitro 2.299s (+18.2% 🔺) 3.011s (+45.0% 🔺) 0.713s 10 1.70x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Next.js (Turbopack) 2.985s (-3.5%) 3.807s (~) 0.821s 8 1.00x
▲ Vercel Express 3.116s (+1.6%) 3.817s (+1.0%) 0.701s 8 1.04x
▲ Vercel Nitro 3.357s (+12.1% 🔺) 4.006s (+8.0% 🔺) 0.649s 8 1.12x

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

Promise.race with 25 concurrent steps

💻 Local Development

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
💻 Local 🥇 Next.js (Turbopack) 2.121s (-2.3%) 2.941s (-1.4%) 0.820s 11 1.00x
💻 Local Nitro 2.309s (-3.7%) 3.246s (~) 0.937s 10 1.09x
💻 Local Express 2.311s (+1.2%) 3.256s (+1.3%) 0.945s 10 1.09x
🌐 Starter Next.js (Turbopack) 2.415s (-1.0%) 3.013s (~) 0.598s 10 1.14x
🌐 Redis Next.js (Turbopack) 2.511s (+1.0%) 3.013s (~) 0.502s 10 1.18x
🐘 Postgres Next.js (Turbopack) 2.559s (-1.2%) 3.026s (~) 0.467s 10 1.21x
🐘 Postgres Express 2.620s (-9.8% 🟢) 3.012s (~) 0.392s 10 1.23x
🐘 Postgres Nitro 2.990s (+13.7% 🔺) 3.681s (+22.3% 🔺) 0.691s 9 1.41x
🌐 MongoDB Next.js (Turbopack) 4.700s (-1.1%) 5.180s (~) 0.480s 6 2.22x
🌐 Turso Next.js (Turbopack) 4.769s (+2.1%) 5.181s (~) 0.411s 6 2.25x

▲ Production (Vercel)

World Framework Workflow Time Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 3.392s (~) 3.981s (+2.4%) 0.589s 8 1.00x
▲ Vercel Express 3.506s (-2.6%) 4.225s (-1.1%) 0.719s 8 1.03x
▲ Vercel Next.js (Turbopack) 3.913s (+17.6% 🔺) 4.813s (+22.7% 🔺) 0.899s 7 1.15x

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

Stream Benchmarks (includes TTFB metrics)
workflow with stream

💻 Local Development

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
🌐 Starter 🥇 Next.js (Turbopack) 0.112s (-11.3% 🟢) 1.006s (~) 0.000s (+Infinity% 🔺) 1.013s (~) 0.901s 10 1.00x
💻 Local Next.js (Turbopack) 0.139s (-2.3%) 1.003s (~) 0.016s (-3.0%) 1.027s (~) 0.888s 10 1.25x
🌐 Redis Next.js (Turbopack) 0.154s (+3.8%) 1.005s (~) 0.000s (-100.0% 🟢) 1.015s (~) 0.861s 10 1.38x
💻 Local Express 0.175s (+1.3%) 0.991s (~) 0.017s (+2.4%) 1.023s (~) 0.848s 10 1.57x
💻 Local Nitro 0.177s (~) 0.992s (~) 0.014s (-17.8% 🟢) 1.020s (~) 0.843s 10 1.59x
🌐 Turso Next.js (Turbopack) 0.467s (-13.7% 🟢) 0.989s (+8.9% 🔺) 0.000s (+Infinity% 🔺) 1.014s (~) 0.548s 10 4.18x
🌐 MongoDB Next.js (Turbopack) 0.490s (-5.8% 🟢) 0.962s (+3.4%) 0.000s (+Infinity% 🔺) 1.014s (~) 0.523s 10 4.40x
🐘 Postgres Next.js (Turbopack) 1.145s (-10.8% 🟢) 1.905s (+8.0% 🔺) 0.000s (+Infinity% 🔺) 2.019s (~) 0.875s 10 10.26x
🐘 Postgres Express 1.151s (-49.0% 🟢) 1.312s (-53.0% 🟢) 0.000s (NaN%) 1.612s (-46.6% 🟢) 0.462s 10 10.31x
🐘 Postgres Nitro 2.275s (-0.8%) 2.768s (+0.6%) 0.000s (-100.0% 🟢) 3.014s (~) 0.739s 10 20.38x

▲ Production (Vercel)

World Framework Workflow Time TTFB Slurp Wall Time Overhead Samples vs Fastest
▲ Vercel 🥇 Nitro 2.904s (-8.1% 🟢) 3.220s (-2.9%) 0.413s (-57.6% 🟢) 4.110s (-13.9% 🟢) 1.205s 10 1.00x
▲ Vercel Express 3.012s (~) 3.172s (-5.3% 🟢) 0.609s (-44.5% 🟢) 4.345s (-12.3% 🟢) 1.333s 10 1.04x
▲ Vercel Next.js (Turbopack) 3.170s (+4.3%) 3.528s (+7.4% 🔺) 0.412s (-47.1% 🟢) 4.549s (+0.9%) 1.379s 10 1.09x

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

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World 🥇 Fastest Framework Wins
💻 Local Next.js (Turbopack) 8/8
🐘 Postgres Next.js (Turbopack) 6/8
▲ Vercel Nitro 4/8
Fastest World by Framework

Winner determined by most benchmark wins

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

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Starter: Community world (local development)
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)

📋 View full workflow run

@github-actions
Copy link
Contributor

github-actions bot commented Jan 15, 2026

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 424 0 38 462
✅ 💻 Local Development 388 0 32 420
✅ 📦 Local Production 388 0 32 420
✅ 🐘 Local Postgres 388 0 32 420
❌ 🪟 Windows 41 1 0 42
❌ 🌍 Community Worlds 159 21 0 180
Total 1788 22 134 1944

❌ Failed Tests

🪟 Windows (1 failed)

nextjs-turbopack (1 failed):

  • webhookWorkflow
🌍 Community Worlds (21 failed)

mongodb (1 failed):

  • webhookWorkflow

redis (1 failed):

  • webhookWorkflow

starter (18 failed):

  • addTenWorkflow
  • addTenWorkflow
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • hookCleanupTestWorkflow - hook token reuse after workflow completion
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars)
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly
  • Calculator.calculate - static workflow method using static step methods from another class
  • AllInOneService.processNumber - static workflow method using sibling static step methods
  • ChainableService.processWithThis - static step methods using this to reference the class
  • thisSerializationWorkflow - step function invoked with .call() and .apply()

turso (1 failed):

  • webhookWorkflow

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 38 0 4
✅ example 38 0 4
✅ express 38 0 4
✅ fastify 38 0 4
✅ hono 38 0 4
✅ nextjs-turbopack 41 0 1
✅ nextjs-webpack 41 0 1
✅ nitro 38 0 4
✅ nuxt 38 0 4
✅ sveltekit 38 0 4
✅ vite 38 0 4
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 38 0 4
✅ express-stable 38 0 4
✅ fastify-stable 38 0 4
✅ hono-stable 38 0 4
✅ nextjs-turbopack-stable 42 0 0
✅ nextjs-webpack-stable 42 0 0
✅ nitro-stable 38 0 4
✅ nuxt-stable 38 0 4
✅ sveltekit-stable 38 0 4
✅ vite-stable 38 0 4
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 38 0 4
✅ express-stable 38 0 4
✅ fastify-stable 38 0 4
✅ hono-stable 38 0 4
✅ nextjs-turbopack-stable 42 0 0
✅ nextjs-webpack-stable 42 0 0
✅ nitro-stable 38 0 4
✅ nuxt-stable 38 0 4
✅ sveltekit-stable 38 0 4
✅ vite-stable 38 0 4
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 38 0 4
✅ express-stable 38 0 4
✅ fastify-stable 38 0 4
✅ hono-stable 38 0 4
✅ nextjs-turbopack-stable 42 0 0
✅ nextjs-webpack-stable 42 0 0
✅ nitro-stable 38 0 4
✅ nuxt-stable 38 0 4
✅ sveltekit-stable 38 0 4
✅ vite-stable 38 0 4
❌ 🪟 Windows
App Passed Failed Skipped
❌ nextjs-turbopack 41 1 0
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 3 0 0
❌ mongodb 41 1 0
✅ redis-dev 3 0 0
❌ redis 41 1 0
✅ starter-dev 3 0 0
❌ starter 24 18 0
✅ turso-dev 3 0 0
❌ turso 41 1 0

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@VaguelySerious VaguelySerious changed the title [ai] Fix collectUiMessages option by refactoring it to use AI SDK's [ai] Fix collectUiMessages option by refactoring it to use AI SDK's readUIMessageStream Jan 15, 2026
@VaguelySerious VaguelySerious changed the title [ai] Fix collectUiMessages option by refactoring it to use AI SDK's readUIMessageStream [ai] Fix collectUiMessages option by refactoring accumulation to happen in a separate step call Jan 15, 2026
@VaguelySerious VaguelySerious changed the title [ai] Fix collectUiMessages option by refactoring accumulation to happen in a separate step call [ai] Fix collectUiMessages option by accumulating chunks in a separate step call Jan 15, 2026
Signed-off-by: Peter Wielander <[email protected]>
Signed-off-by: Peter Wielander <[email protected]>
Signed-off-by: Peter Wielander <[email protected]>
When a step function is invoked, only capture `this` if it has a
`classId` property (indicating it's a class constructor registered
for serialization by the SWC plugin).

This prevents serialization errors when step functions are called as
methods on arbitrary objects (e.g., `tool.execute()`) where the object
has non-serializable properties like Zod schemas.
@VaguelySerious VaguelySerious changed the base branch from main to peter/fix-step-serialization January 15, 2026 14:04
I, Peter Wielander <[email protected]>, hereby add my Signed-off-by to this commit: 0e8fe8c

Signed-off-by: Peter Wielander <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants