Skip to content

docs(ai): clean up WorkflowAgent docs and examples - #3891

Merged
VaguelySerious merged 20 commits into
mainfrom
codex/ai-gateway-workflow-agent
Sep 11, 2026
Merged

VaguelySerious merged 20 commits into
mainfrom
codex/ai-gateway-workflow-agent

Conversation

@NathanColosimo

@NathanColosimo NathanColosimo commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • default Workflow 4 and 5 AI docs/examples to Vercel AI Gateway with spacexai/grok-4.6, while retaining direct provider-package alternatives
  • recommend AI SDK v7 WorkflowAgent exclusively for new Workflow 5 agents, deprecate the legacy @workflow/ai surface, and migrate the flagship v5 chat workbench to AI SDK 7
  • correct multi-turn stream lifecycle and the 100-turn boundary, use the exported prepareStep types, and give queued Hook messages a single FIFO ownership path
  • replay raw model parts from zero before applying the UI resume cursor, centralize the workbench model catalog, and remove stale model IDs and capability gaps
  • migrate cancellation guidance to WorkflowAgent with Hook-driven graceful cancellation and a run-cancellation fallback
  • sign and verify WorkflowAgent approval requests using a secret environment-variable reference
  • migrate the shared agent E2Es and affected workbenches to AI SDK 7.0.87 and WorkflowAgent 2.0.17

Testing

  • pnpm typecheck
  • pnpm lint (passes with existing advisory warnings)
  • pnpm --filter docs build
  • pnpm --filter docs lint:links
  • pnpm --filter @workflow/ai build
  • pnpm --dir packages/ai test (184 pass; 22 intentional expected failures)
  • focused pnpm test:docs runs for every corrected page
  • pnpm --dir workbench/nextjs-turbopack build
  • DEPLOYMENT_URL=http://localhost:3000 APP_NAME=nextjs-turbopack pnpm vitest run packages/core/e2e/e2e-agent.test.ts (19 pass)
  • pnpm --dir workbench/nextjs-webpack build
  • pnpm --dir workbench/sveltekit check
  • pnpm --dir workbench/nitro-v3 build

Docs Preview

Base: workflow-docs preview

Page v5 v4
AI overview v5 v4
Chat session modeling v5 v4
Message queueing v5 v4
DurableAgent API v5 v4
Serializable steps v5 v4
Agent cancellation v5 v4
Human in the loop v5 v4
AI SDK integration v5 v4
Fetch in workflow v5 v4
Streaming v5 v4
API reference v5 —
Workflow AI API v5 —
Durable agent pattern v5 —

@NathanColosimo
NathanColosimo requested a review from a team as a code owner August 28, 2026 21:42
@changeset-bot

changeset-bot Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d4163d4

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

This PR includes changesets to release 18 packages
Name Type
@workflow/rollup Patch
workflow Patch
@workflow/core Patch
@workflow/ai Patch
@workflow/swc-plugin Patch
@workflow/astro Patch
@workflow/nitro Patch
@workflow/sveltekit Patch
@workflow/vitest Patch
@workflow/world-testing Patch
@workflow/builders Patch
@workflow/cli Patch
@workflow/next Patch
@workflow/web-shared Patch
@workflow/web Patch
@workflow/nest Patch
@workflow/nuxt Patch
@workflow/vite 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

vercel Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
example-nextjs-workflow-turbopack Ready Ready Preview, v0 Sep 11, 2026 6:08pm UTC
example-nextjs-workflow-webpack Ready Ready Preview, v0 Sep 11, 2026 6:08pm UTC
example-workflow Ready Ready Preview, v0 Sep 11, 2026 6:08pm UTC
workbench-astro-workflow Ready Ready Preview, v0 Sep 11, 2026 6:08pm UTC
workbench-express-workflow Ready Ready Preview, v0 Sep 11, 2026 6:08pm UTC
workbench-fastify-workflow Ready Ready Preview, v0 Sep 11, 2026 6:08pm UTC
workbench-hono-workflow Ready Ready Preview, v0 Sep 11, 2026 6:08pm UTC
workbench-nestjs-workflow Ready Ready Preview, v0 Sep 11, 2026 6:08pm UTC
workbench-nitro-workflow Ready Ready Preview, v0 Sep 11, 2026 6:08pm UTC
workbench-nuxt-workflow Ready Ready Preview, v0 Sep 11, 2026 6:08pm UTC
workbench-python-workflow Ready Ready Preview, v0 Sep 11, 2026 6:08pm UTC
workbench-sveltekit-workflow Ready Ready Preview, v0 Sep 11, 2026 6:08pm UTC
workbench-tanstack-start-workflow Ready Ready Preview, v0 Sep 11, 2026 6:08pm UTC
workbench-vite-workflow Ready Ready Preview, v0 Sep 11, 2026 6:08pm UTC
workflow-docs Ready Ready Preview, v0 Sep 11, 2026 6:08pm UTC
workflow-swc-playground Ready Ready Preview, v0 Sep 11, 2026 6:08pm UTC
workflow-tarballs Ready Ready Preview, v0 Sep 11, 2026 6:08pm UTC
workflow-web Ready Ready Preview, v0 Sep 11, 2026 6:08pm UTC

@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

❌ Some tests failed

❌ Failed E2E Tests

vercel-multi-region (2 failed)

nextjs-turbopack (2 failed):

  • multi-region (world-vercel) explicit region: start({ region }) in the test process every provisioned region executes and completes a tagged run
  • multi-region (world-vercel) implicit region: region-pinned routes without a region option /api/e2e-region-implicit/hnd1 mints a run tagged with its VERCEL_REGION

⚠️ Flaky E2E Tests (passed on retry)

These tests failed at least once and passed on a retry. A recurring entry here is a real race worth investigating.

  • cancelRun via CLI - cancelling a running workflow (astro)
  • cancelRun via CLI - cancelling a running workflow (express)
  • cancelRun via CLI - cancelling a running workflow (nextjs-turbopack)
  • cancelRun via CLI - cancelling a running workflow (sveltekit)
  • cancelRun via CLI - cancelling a running workflow (vite)
  • experimental_retention: 0 purges the run payloads once the run finishes (tanstack-start)
  • sleepWinsRaceWorkflow (tanstack-start)

🛠 Infra Events (absorbed by the harness)

Platform anomalies the e2e harness detected and worked around (e.g. a run the queue never picked up, replaced by a fresh run). Clustered timestamps indicate a backend blip; a steady drip indicates a platform issue worth escalating.

  • run-pickup-stall · hookWorkflow (nuxt) · at 18:11:05Z · abandoned wrun_01M28TMHRTP66FAKVFCD1RM36B
  • cold-start-warmup · suite warmup (tanstack-start) · at 18:11:07Z · abandoned wrun_01M28TKRJ0HM6N2DPD74QRB9GB · (+1 more)
  • run-pickup-stall · hookCleanupTestWorkflow - hook token reuse after workflow completion (nextjs-webpack) · at 18:17:59Z · abandoned wrun_01M28V15R8XWJQF143CH07393Y

E2E Test Summary

Summary
Passed Failed Skipped Total
✅ ▲ Vercel Production 3662 0 685 4347
✅ 💻 Local Development 3998 0 510 4508
✅ 📦 Local Production 3998 0 510 4508
✅ 🐘 Local Postgres 3998 0 510 4508
✅ 🪟 Windows 320 0 2 322
✅ 🌐 Cross-language Conformance 68 0 74 142
✅ vercel-http-transport 823 0 143 966
❌ vercel-multi-region 25 2 0 27
✅ vercel-ws-transport 557 0 87 644
Total 17449 2 2521 19972
Details by Category

✅ ▲ Vercel Production

App Passed Failed Skipped
✅ astro-node 133 0 28
✅ astro-quickjs 133 0 28
✅ example-node 133 0 28
✅ example-quickjs 133 0 28
✅ express-node 133 0 28
✅ express-quickjs 133 0 28
✅ fastify-node 133 0 28
✅ fastify-quickjs 133 0 28
✅ hono-node 133 0 28
✅ hono-quickjs 133 0 28
✅ nest-node 133 0 28
✅ nest-quickjs 133 0 28
✅ nextjs-turbopack-node 158 0 3
✅ nextjs-turbopack-quickjs 158 0 3
✅ nextjs-webpack-node 158 0 3
✅ nextjs-webpack-quickjs 158 0 3
✅ nitro-node 133 0 28
✅ nitro-quickjs 133 0 28
✅ nuxt-node 133 0 28
✅ nuxt-quickjs 133 0 28
✅ python-node 66 0 95
✅ sveltekit-node 152 0 9
✅ sveltekit-quickjs 152 0 9
✅ tanstack-start-node 133 0 28
✅ tanstack-start-quickjs 133 0 28
✅ vite-node 133 0 28
✅ vite-quickjs 133 0 28

✅ 💻 Local Development

App Passed Failed Skipped
✅ astro-stable-node 134 0 27
✅ astro-stable-quickjs 134 0 27
✅ express-stable-node 134 0 27
✅ express-stable-quickjs 134 0 27
✅ fastify-stable-node 134 0 27
✅ fastify-stable-quickjs 134 0 27
✅ hono-stable-node 134 0 27
✅ hono-stable-quickjs 134 0 27
✅ nest-stable-node 134 0 27
✅ nest-stable-quickjs 134 0 27
✅ nextjs-turbopack-canary-node 160 0 1
✅ nextjs-turbopack-canary-quickjs 160 0 1
✅ nextjs-turbopack-stable-node 160 0 1
✅ nextjs-turbopack-stable-quickjs 160 0 1
✅ nextjs-webpack-canary-node 160 0 1
✅ nextjs-webpack-canary-quickjs 160 0 1
✅ nextjs-webpack-stable-node 160 0 1
✅ nextjs-webpack-stable-quickjs 160 0 1
✅ nitro-stable-node 134 0 27
✅ nitro-stable-quickjs 134 0 27
✅ nuxt-stable-node 134 0 27
✅ nuxt-stable-quickjs 134 0 27
✅ sveltekit-stable-node 153 0 8
✅ sveltekit-stable-quickjs 153 0 8
✅ tanstack-start-node 134 0 27
✅ tanstack-start-quickjs 134 0 27
✅ vite-stable-node 134 0 27
✅ vite-stable-quickjs 134 0 27

✅ 📦 Local Production

App Passed Failed Skipped
✅ astro-stable-node 134 0 27
✅ astro-stable-quickjs 134 0 27
✅ express-stable-node 134 0 27
✅ express-stable-quickjs 134 0 27
✅ fastify-stable-node 134 0 27
✅ fastify-stable-quickjs 134 0 27
✅ hono-stable-node 134 0 27
✅ hono-stable-quickjs 134 0 27
✅ nest-stable-node 134 0 27
✅ nest-stable-quickjs 134 0 27
✅ nextjs-turbopack-canary-node 160 0 1
✅ nextjs-turbopack-canary-quickjs 160 0 1
✅ nextjs-turbopack-stable-node 160 0 1
✅ nextjs-turbopack-stable-quickjs 160 0 1
✅ nextjs-webpack-canary-node 160 0 1
✅ nextjs-webpack-canary-quickjs 160 0 1
✅ nextjs-webpack-stable-node 160 0 1
✅ nextjs-webpack-stable-quickjs 160 0 1
✅ nitro-stable-node 134 0 27
✅ nitro-stable-quickjs 134 0 27
✅ nuxt-stable-node 134 0 27
✅ nuxt-stable-quickjs 134 0 27
✅ sveltekit-stable-node 153 0 8
✅ sveltekit-stable-quickjs 153 0 8
✅ tanstack-start-node 134 0 27
✅ tanstack-start-quickjs 134 0 27
✅ vite-stable-node 134 0 27
✅ vite-stable-quickjs 134 0 27

✅ 🐘 Local Postgres

App Passed Failed Skipped
✅ astro-stable-node 134 0 27
✅ astro-stable-quickjs 134 0 27
✅ express-stable-node 134 0 27
✅ express-stable-quickjs 134 0 27
✅ fastify-stable-node 134 0 27
✅ fastify-stable-quickjs 134 0 27
✅ hono-stable-node 134 0 27
✅ hono-stable-quickjs 134 0 27
✅ nest-stable-node 134 0 27
✅ nest-stable-quickjs 134 0 27
✅ nextjs-turbopack-canary-node 160 0 1
✅ nextjs-turbopack-canary-quickjs 160 0 1
✅ nextjs-turbopack-stable-node 160 0 1
✅ nextjs-turbopack-stable-quickjs 160 0 1
✅ nextjs-webpack-canary-node 160 0 1
✅ nextjs-webpack-canary-quickjs 160 0 1
✅ nextjs-webpack-stable-node 160 0 1
✅ nextjs-webpack-stable-quickjs 160 0 1
✅ nitro-stable-node 134 0 27
✅ nitro-stable-quickjs 134 0 27
✅ nuxt-stable-node 134 0 27
✅ nuxt-stable-quickjs 134 0 27
✅ sveltekit-stable-node 153 0 8
✅ sveltekit-stable-quickjs 153 0 8
✅ tanstack-start-node 134 0 27
✅ tanstack-start-quickjs 134 0 27
✅ vite-stable-node 134 0 27
✅ vite-stable-quickjs 134 0 27

✅ 🪟 Windows

App Passed Failed Skipped
✅ nextjs-turbopack-node 160 0 1
✅ nextjs-turbopack-quickjs 160 0 1

✅ 🌐 Cross-language Conformance

App Passed Failed Skipped
✅ python 68 0 74

✅ vercel-http-transport

App Passed Failed Skipped
✅ example 133 0 28
✅ express 133 0 28
✅ hono 133 0 28
✅ nextjs-turbopack 158 0 3
✅ nitro 133 0 28
✅ vite 133 0 28

❌ vercel-multi-region

App Passed Failed Skipped
❌ nextjs-turbopack 25 2 0

✅ vercel-ws-transport

App Passed Failed Skipped
✅ example 133 0 28
✅ express 133 0 28
✅ nextjs-turbopack 158 0 3
✅ vite 133 0 28

📋 View full workflow run

@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

📊 Workflow Benchmarks

commit d4163d4 · Fri, 11 Sep 2026 18:32:26 GMT · run logs

Backend: vercel · app: nextjs-turbopack

Metric Scenario Best (ms) P75 (ms) P90 (ms) P99 (ms) Samples
TTFS step 205 (+3.5%) 1672 🔴 (+30%) 🔻 1709 🔴 (+30%) 🔻 1853 🔴 (+37%) 🔻 30
TTFS stream 188 (-84%) 💚 1669 🔴 (+29%) 🔻 1717 🔴 (+27%) 🔻 1928 🔴 (+25%) 🔻 30
TTFS hook + stream 638 (-56%) 💚 2166 🔴 (+28%) 🔻 2208 🔴 (+29%) 🔻 2547 🔴 (+39%) 🔻 30
Fan-out TTFS Promise.all(100 steps) 593 (-11%) 1347 (+62%) 🔻 2467 (+191%) 🔻 2797 (+9.7%) 10
Fan-out TTLS Promise.all(100 steps) 2559 (+44%) 🔻 5617 (+20%) 🔻 5752 (-27%) 💚 8911 (-6.2%) 10
STSO 1020 steps (inline) 145 (+61%) 🔻 185 (+30%) 🔻 215 (+34%) 🔻 798 (+215%) 🔻 1019
WO 1020 steps 195160 (+35%) 🔻 195160 (+35%) 🔻 195160 (+35%) 🔻 195160 (+35%) 🔻 1
CRTT first chunk (pooled) 68 (+42%) 🔻 119 (+40%) 🔻 144 (+60%) 🔻 215 (+42%) 🔻 28

Streams

Scenario CRTT 1st p75 p90 p99 CDV max iters
paced control (100/s, 60B) 96.5 (+20%) 152 (+13%) 209 (-6%) 338 (-21%) 124 (-14%) 10
size sweep (100/s, 160B-12KB) 106 (+31%) 161 (+1%) 225 (-45%) 452 (-32%) 145 (+5%) 10
replay gateway-gpt-5.4-nano-2000t (1x) 110 (+53%) 624 (+424%) 3261 (+1876%) 4913 (+1398%) 339 (+47%) 3
replay eve-gpt-5.6-sol-2000t (1x) 98.5 (+17%) 153 (+34%) 209 (+50%) 419 (+47%) 387 (+14%) 2
replay eve-gpt-5.6-sol-2000t (2x) 106 (+25%) 242 (+34%) 385 (+52%) 645 (+36%) 290 (+34%) 3
📈 STSO distribution vs main (inline / queue-hop histograms)

1020 steps (inline)

Cumulative STSO time: main 144355ms → this run 194992ms (Δ +50637ms, +35%)

   50-100 ms  ┃                         main   2  this   0    -2
  100-150 ms  ┃███████████████████████  main 841  this  25  -816
  150-200 ms  ████░░░░░░░░░░░░░░░░░░░┃  main 153  this 839  +686
  200-250 ms  █░┃                       main  12  this  92   +80
  250-300 ms  ┃                         main   7  this  24   +17
  300-350 ms  ┃                         main   2  this  12   +10
  350-400 ms  ┃                         main   0  this   5    +5
  400-450 ms  ┃                         main   1  this   1    +0
  450-500 ms  ┃                         main   0  this   3    +3
  500-550 ms  ┃                         main   0  this   3    +3
  600-650 ms  ┃                         main   0  this   2    +2
  700-750 ms  ┃                         main   0  this   1    +1
  750-800 ms  ┃                         main   0  this   2    +2
  800-850 ms  ┃                         main   0  this   1    +1
  900-950 ms  ┃                         main   1  this   0    -1
 950-1000 ms  ┃                         main   0  this   1    +1
1000-1050 ms  ┃                         main   0  this   2    +2
1100-1150 ms  ┃                         main   0  this   2    +2
1150-1200 ms  ┃                         main   0  this   1    +1
1350-1400 ms  ┃                         main   0  this   1    +1
1400-1450 ms  ┃                         main   0  this   1    +1
1450-1500 ms  ┃                         main   0  this   1    +1
📈 CRTT drill-down vs main (RTT distributions & profiles)
variant  RTT 1ms→5s+              avg         p50            p90            p99     n
control  ······▃█▁····   130.5 (+14%)  124 (+20%)      209 (-6%)     338 (-21%)  3000
sweep    ······▃█▂····    137.6 (+9%)  125 (+21%)     225 (-45%)     452 (-32%)  3000
gw 1x    ·····▁▅█▂▁▁▁▁  359.5 (+239%)  114 (+16%)  3261 (+1876%)  4913 (+1398%)  5295
eve 1x   ·····▁▅█▂▁···   131.7 (+31%)  115 (+22%)     209 (+50%)     419 (+47%)  5186
eve 2x   ·····▁▂█▄▁···   186.4 (+32%)  157 (+26%)     385 (+52%)     645 (+36%)  7779

RTT over stream progress (avg per tenth of stream, bars scaled min→max):

control  █▅▂▁▃▂▂▂▃▃  118–161ms
sweep    █▅█▆▆▂▁▂▃▁  110–170ms
gw 1x    █▇▃▁▁▁▂▁▁▁  109–1210ms
eve 1x   ▃▂▁▄▃▃▇█▄▁  115–158ms
eve 2x   ▂▃▃▂▁▂▄█▂▂  138–313ms

RTT by chunk size (avg per log size bin, ~160B → ~12KB serialized, bars scaled min→max):

sweep  ▇█▄▃▁▂▃  136–139ms

Delivery jitter over stream progress (avg positive CDV per tenth of stream, bars scaled min→max):

control  █▄▃▁▅▁▃▃▂▃  38–53ms
sweep    ▅█▇▇▄▃▃▃▅▁  41–72ms
gw 1x    █▂▁▁▁▃▄▃▂▁  33–94ms
eve 1x   ▂▅▁▃█▂▆▄▃▅  22–33ms
eve 2x   █▆▃▄▃▄▃▁▁▅  26–34ms
ℹ️ Metric definitions & methodology

Streams: first-chunk RTT (the stream-open path, before any buffering/backpressure), CRTT percentiles, and worst delivery stall (CDV max). Cells are medians across iterations; per-run values in the artifacts. No 🔴/🟢 marks until targets attach.

The collapsed STSO distribution section above buckets every step gap, split inline (same warm process — pure framework overhead) vs queue-hop (fresh process — dispatch, reinit, replay). █ = main, ┃ = this run, ░ = fill.

The collapsed CRTT drill-down: per-variant RTT histograms (fixed log bins, · = empty) and mean RTT/positive-CDV profile lines over stream progress and chunk size. Histograms, avgs, and profiles merge exactly across runs; p50–p99 are percentile-of-percentiles. Per-index rows live in the artifacts.

Best/P75/P90/P99 deltas compare against the most recent benchmark run on main at the time of this run. 🔻 flags a delta worse than +15%, 💚 one better than −15%.

Metrics — TTFS: time to first step body (in-deployment start() → first step body) · Fan-out TTFS: fan-out time to first step (in-deployment start() → first of the parallel step bodies to complete) · Fan-out TTLS: fan-out time to last step (in-deployment start() → last of the parallel step bodies to complete, i.e. when the Promise.all resolves) · STSO: step-to-step overhead (gap between consecutive step bodies) · WO: workflow overhead (whole-run time outside step bodies, in-deployment anchored) · CRTT: chunk round-trip time (per-chunk write → read latency, one clock domain: deployment → stream backend → same deployment) · CDV: chunk delay variation / delivery jitter (inter-arrival gap minus inter-write gap per seq-adjacent pair; skew-free; the row is each run's MAX positive value, so one stall moves it)

Scenarios — step: one trivial no-op step, no stream; no hooks, so the run stays in turbo mode (in-process fast path) · stream: one streaming step; no hooks, so the run stays in turbo mode (in-process fast path) · hook + stream: registers a hook before one step, which exits turbo mode (dispatch path) · 1020 steps: 1020 trivial sequential steps; STSO is measured between consecutive steps in the given step ranges, and WO is the whole-run overhead outside step bodies · Promise.all(100 steps): 100 trivial no-op steps started together in a single Promise.all; Fan-out TTFS is the first of them to complete and Fan-out TTLS the last, both from the in-deployment clientStart, so their gap is the spread the runtime adds across the fan-out · paced control (100/s, 60B): the control: 300 tiny (~60B) deltas metronome-paced at 100/s — zero workload structure, so it reads the transport floor and flush cadence, and disambiguates transport-wide vs workload-specific when a replay row moves · size sweep (100/s, 160B-12KB): same pacing as the control with deltas padded in rotation across seven log-spaced sizes (~160B–12KB) — rotation decouples size from stream position, so it isolates whether chunk size causes latency · replay gateway-gpt-5.4-nano-2000t (1x): raw provider SSE cadence captured at the AI gateway boundary (gpt-5.4-nano, the most popular gateway model; per-token deltas p50 208B = the modal production chunk size), replayed exactly as measured — the typical customer's workload; its CDV is the typical customer's real delivery jitter · replay eve-gpt-5.6-sol-2000t (1x): a captured eve turn (gpt-5.6-sol, the most-used demanding eve model; ~2000 output tokens = production p50 turn length) replayed exactly as measured — eve's envelope protocol re-ships the cumulative message so sizes ramp 142B→13KB; the demanding outlier tenant's reality · replay eve-gpt-5.6-sol-2000t (2x): the same eve capture at 2x — the headroom/stress row; real fast-tier models emit the same chunk sizes at proportionally higher rate, so time compression is a faithful speed model · first chunk (pooled): every run's seq-0 RTT pooled across all stream scenarios — the first chunk precedes any workload differentiation, so pooling samples one shared stream-open path with exact percentiles

Replay cadences (semantic sha256) — eve-gpt-5.6-sol-2000t eaf22f5946e7c61f3c65c7006d550df180cfabd4e706254a09f22aec0cfb420d · gateway-gpt-5.4-nano-2000t 6f24ac518b6b83ff1d0e85a5fe78230db192716d66a7fc6b2fe022752001d041

🔴 marks a percentile over its target (within target is left unmarked). Targets (p75/p90/p99, ms) — TTFS 200/300/600

All timestamps are deployment-side; runs are triggered in-deployment, so the CI runner and api.vercel.com sit outside every measured window. TTFS = start() → first step body (includes dispatch + any cold start); Fan-out TTFS/TTLS = first/last step completion of one Promise.all from the same anchor (the gap is the runtime’s fan-out spread); STSO/WO between step bodies; CRTT inside the workflow (excludes the api.vercel.com read path).

Cold starts stay in the numbers (real bursty-workload latency, inflates P75+); Best is the warm floor.

@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Sim World

Simulated world deterministic testing for races. Traces

🟠 world-sim scenario book — 1 fail of 41 total

fence=per-spec

scenario outcome events virt replay violations
✅ smoke-no-steps completed 3 0ms ok 0
✅ smoke-one-step completed 6 0ms ok 0
✅ hook-at-step-started completed 12 0ms ok 0
✅ hook-at-step-completed completed 12 0ms ok 0
✅ hook-at-hook-created completed 12 0ms ok 0
✅ deadline-hook-wins completed 7 1.0h ok 0
✅ deadline-expires completed 7 1.0h ok 0
✅ long-sleep completed 11 30.0d ok 0
✅ hook-never-arrives stalled 3 0ms skipped 0
✅ step-retries-twice completed 10 2.0s ok 0
✅ parallel-steps completed 9 0ms ok 0
✅ hook-on-execution-state completed 12 0ms ok 0
✅ peek-hook-before-branch completed 12 0ms ok 0
✅ peek-hook-after-branch completed 12 0ms ok 0
✅ peek-hook-at-registration completed 12 0ms ok 0
✅ race-hook-before-probe completed 12 0ms ok 0
✅ race-hook-after-probe completed 12 0ms ok 0
✅ race-duplicate-delivery completed 13 0ms ok 0
✅ attr-hook-before-step completed 11 0ms ok 0
✅ attr-hook-after-step completed 11 0ms ok 0
✅ attr-from-step-body completed 13 0ms ok 0
✅ fork-hook-after-timeout completed 14 1.0m ok 0
✅ fork-hook-before-timeout completed 14 1.0m ok 0
✅ count-hook-after-timeout completed 17 1.0m ok 0
✅ count-hook-before-timeout completed 20 1.0m ok 0
✅ stale-read-step-count-fork completed 20 1.0m ok 0
✅ stale-read-equal-step-counts completed 14 1.0m ok 0
✅ step-vs-step-fork completed 12 0ms ok 0
✅ step-vs-step-fork-fenced completed 12 0ms ok 0
✅ fence-catches-benign-direction completed 12 5ms ok 0
✅ in-flight-before-decision completed 17 1.0m ok 0
❌ in-flight-before-decision-counted completed 17 1.0m ok 0
✅ in-flight-after-decision completed 19 2.0m ok 0
✅ stale-read-step-count-fork-fenced completed 20 1.0m ok 0
✅ fork-hook-wins completed 13 1.0m ok 0
✅ fork-timeout-wins completed 13 1.0m ok 0
✅ unclaimed-payload-under-fork completed 17 1.0m ok 0
✅ claimed-payload-under-fork completed 17 1.0m ok 0
✅ writers-independent-step-bodies completed 12 0ms ok 0
✅ writers-scripted-tempo completed 12 0ms ok 0
✅ cancel-mid-step cancelled 7 0ms skipped 0

Full trace: world-sim.txt

@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor
Framework Flow route Step reg. Framework output
hono 250.7 KiB (+14.7 KiB) ⚠️ 93.0 KiB (+50.7 KiB) ⚠️ 1.88 MiB (+73.5 KiB)
nextjs-turbopack 257.2 KiB (+14.9 KiB) ⚠️ 426 B (-13 B) 895.5 KiB (+59.1 KiB)
About these numbers

Sizes are gzip; parentheses show the change against main.
Flow route and Step reg. gate this job, on raw bytes rather than the gzip shown, at max(2%, 50.0 KiB). Framework output is informational.
⚠️ marks growth past the threshold. Add the allow-bundle-size-growth label to accept it.

d4163d4 · run

@socket-security

socket-security Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​ai-sdk/​react@​2.0.76 ⏵ 4.0.8899 +110075 +398100
Addednpm/​@​ai-sdk/​workflow@​2.0.15991009898100
Updatednpm/​ai@​5.0.76 ⏵ 7.0.8599 +410010099100

View full report

Comment thread .changeset/fluffy-apes-worry.md Resolved
Comment thread packages/ai/src/agent/durable-agent.ts Resolved
NathanColosimo and others added 9 commits September 1, 2026 12:30
…flow-agent

# Conflicts:
#	pnpm-workspace.yaml
Resolved conflicts:
- skills/workflow/SKILL.md: version counter bump (both sides bumped
  it independently for unrelated content changes; the file bodies
  merged cleanly, so bumped to 1.16, above both parents' 1.12/1.15).
- pnpm-lock.yaml: regenerated from main's lockfile plus this branch's
  ai-sdk-v7 named catalog additions.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
VaguelySerious and others added 2 commits September 11, 2026 09:05
main advanced since the previous merge (notably #3902's Zod 4.5
upgrade and #3941's step-stream drain fix). Only pnpm-lock.yaml
conflicted; resolved by taking main's lockfile and reinstalling to
fold this branch's ai-sdk-v7 named catalog additions back in.
Everything else merged cleanly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The vite and tanstack-start workbench apps' deployed functions crashed
at module load with:

  TypeError: Cannot redefine property: classId
      at Object.defineProperty (<anonymous>)
      at file:///var/task/_libs/ai-sdk__gateway.mjs:791:10

The SWC transform inlines a self-contained IIFE around any class that
defines WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE (including third-party
ones with no dependency on the `workflow` package, such as
@ai-sdk/gateway's GatewayLanguageModel), stamping a non-configurable
`classId` via Object.defineProperty. The class resolves its
registration name from the variable it's bound to per "Class names for
IDs" in spec.md (`var Foo = class _Foo {}` registers as `Foo`, not
`_Foo`).

Some Vite/Nitro SSR pipelines re-run this transform over its own
output for a dependency reached through more than one build stage. On
the second pass the class is no longer a bare initializer -- it's now
wrapped in the first pass's registration call -- so the binding-name
resolution can't reach it and the transform falls back to the class
expression's own inner name instead, nesting a second registration
IIFE around the first. The second, unguarded `defineProperty` call
then throws, since the first already made `classId` non-configurable.

Verified against the actual crash: pulled the real Vercel runtime logs
for the failing deployments via ClickHouse (the CI-captured runtime
logs artifact was empty for these lanes), reproduced the exact
GatewayLanguageModel double-wrap locally by feeding a first pass's
transformed output back through `workflow transform`, and confirmed
both workbench apps serve /.well-known/workflow/v1/manifest.json
without crashing after the fix.

Fix: guard the classId `Object.defineProperty` call with a
`hasOwnProperty` check in `class_registration_stmts`, so a class this
transform visits more than once keeps working instead of crashing.
The registry `.set()` call stays unconditional, so the class remains
reachable under whichever id each pass derived. Updated spec.md's
generated-output examples and added a regression test that transforms
a named-class-expression fixture twice and executes the result.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

No backport to stable for c29200f (AI decision).

This commit mixes two real bug fixes with a large amount of feature/migration work, and a mixed commit counts as feature work. The fixes are the SWC plugin's hasOwnProperty guard around classId (avoiding a "Cannot redefine property: classId" crash when a bundler re-runs the transform over its own output) and @workflow/rollup setting inputSourceMap: false to avoid false missing-map build errors; both are separable and could be forced through individually via workflow_dispatch. Everything else — recommending AI SDK 7 WorkflowAgent over the deprecated @workflow/ai surface, switching docs/examples to AI Gateway with spacexai/grok-4.6, signed tool-approval support, and migrating the workbenches and agent E2Es to AI SDK 7.0.87 — is new-capability and guidance work that does not belong on a maintenance line.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

c29200fac5848fb8e40bf77351b5b69d10a31357

This branch was successfully deployed

18 active deployments
Preview – workflow-swc-playground — d4163d4b Deployed Sep 11, 2026 by vercel[bot]
Preview – example-nextjs-workflow-webpack — d4163d4b Deployed Sep 11, 2026 by vercel[bot]
Preview – workbench-nuxt-workflow — d4163d4b Deployed Sep 11, 2026 by vercel[bot]
Preview – workflow-docs — d4163d4b Deployed Sep 11, 2026 by vercel[bot]
Preview – example-nextjs-workflow-turbopack — d4163d4b Deployed Sep 11, 2026 by vercel[bot]
Preview – workflow-tarballs — d4163d4b Deployed Sep 11, 2026 by vercel[bot]
Preview – example-workflow — d4163d4b Deployed Sep 11, 2026 by vercel[bot]
Preview – workbench-nestjs-workflow — d4163d4b Deployed Sep 11, 2026 by vercel[bot]
Preview – workbench-fastify-workflow — d4163d4b Deployed Sep 11, 2026 by vercel[bot]
Preview – workbench-nitro-workflow — d4163d4b Deployed Sep 11, 2026 by vercel[bot]
Preview – workbench-astro-workflow — d4163d4b Deployed Sep 11, 2026 by vercel[bot]
Preview – workbench-hono-workflow — d4163d4b Deployed Sep 11, 2026 by vercel[bot]
Preview – workbench-sveltekit-workflow — d4163d4b Deployed Sep 11, 2026 by vercel[bot]
Preview – workbench-vite-workflow — d4163d4b Deployed Sep 11, 2026 by vercel[bot]
Preview – workbench-tanstack-start-workflow — d4163d4b Deployed Sep 11, 2026 by vercel[bot]
Preview – workbench-express-workflow — d4163d4b Deployed Sep 11, 2026 by vercel[bot]
Preview – workflow-web — d4163d4b Deployed Sep 11, 2026 by vercel[bot]
Preview – workbench-python-workflow — d4163d4b Deployed Sep 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

allow-bundle-size-growth Accept intentional bundle-size growth for this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants