Skip to content

Fix CI on stable: step stream writes, unit-job builds, community-world lanes, Nitro remoteAddress crash - #5683

Open
pranaygp wants to merge 3 commits into
stablefrom
pgp/fix-ci-stable
Open

pranaygp wants to merge 3 commits into
stablefrom
pgp/fix-ci-stable

Conversation

@pranaygp

@pranaygp pranaygp commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What

Fixes what keeps CI red on stable, at the cause where the cause is in this repository.

  • @workflow/core: a step's stream writes could arrive after the run completed and be dropped. A step now waits for the stream writes it requested before writing its terminal event. This is what hung webhookWorkflow on the astro Vercel lane.
  • @workflow/core: a failed stream read left the reader pending forever. The reader now rejects.
  • Unit job: package builds ran alongside the test suites. They now run in their own step first.
  • Community-world lanes (Turso, Redis, MongoDB): harness defects and overruns. Fixed where the defect is ours; bounded so an overrun cannot cancel the Tests run.
  • Express and fastify workbench deployments answer 500. Same Nitro pnpm patch as Fix CI on main: abort-stream decode cost, wedged-session test deadline #5682. Upstream fix: presets(vercel): keep remoteAddress redefinable on keep-alive sockets nitrojs/nitro#5178.
  • The workbench-python-workflow Vercel project failed on every stable commit. workbench/python/vercel.json turns Git deployments off for this branch, which has no Python workbench.

No test timeout is raised: the forked-writers test is back to its 30s budget.

Reviewers: the first item is a runtime behaviour change on the maintenance branch. It is its own commit ([core] Settle a step's stream writes before its terminal event); see "Cost and divergence from main" below.

Why

1. Step stream writes (E2E Vercel Prod Tests (astro) on b0a1907df, failed the required check)

webhookWorkflow timed out at 120s although its run completed in 6s.

  • A step wrote step_completed without waiting for the stream writes it had requested, and request.respondWith() resolved before its Response had been written to the server.
  • The workflow therefore finished while the first write to the webhook response stream was still in flight.
  • The server does not create a stream for a run in a terminal state, so it answered that write with 409 and the Response was lost.
  • The webhook handler waited the server's 120s stream limit and failed with "Workflow run did not send a response".

The 409 and the 120s gap were read from the server and deployment logs for that run. The hang has not been reproduced end to end on a Vercel deployment.

Fix. Before a step writes its terminal event, whether it returned or threw, it waits for the stream writes requested so far to be confirmed by the server: awaited and un-awaited writes, and requested closes, on writables passed as arguments and on those from getWritable(). request.respondWith() resolves only once the Response and its body are written. The wait is capped at 30s; a failed or timed-out wait is logged and never fails the step.

Cost and divergence from main.

Per step that writes to a stream about 12ms on world-local; one stream write round trip on Vercel
Step that holds a writable without writing about 1.4ms
100 un-awaited writes about 1.2s on world-local (one flush per chunk)
Stream backend hanging up to 30s per writing step; up to 60s with respondWith()

This is not a backport of #3941 (main's "drain step stream writes before completion"). That mechanism lives in step-executor.ts and depends on code stable does not have, would need at least #4387, #4605 and #4667 with it, and does not make respondWith() wait, so it would not fix the webhook. main still has the respondWith() hole and needs a follow-up.

2. Stream read errors

flushablePipe rejected its own promise on a source error but never aborted the sink. A consumer reading the other side of a transform (run.getReadable()) stayed pending forever. main already aborts the sink here. Found through the community-world lanes, where a world's stream read throws on a negative start index and the test then waited out its 60s deadline.

3. Unit job (Unit Tests (windows-latest), forked-writers test timing out at 30s)

  • pnpm test builds each test task's package dependencies in the same turbo run as the tests. On a turbo cache miss those builds share the 4-core runner with the test suites.
  • In 33 Windows unit jobs on stable since the test landed, it timed out four times; all four jobs were executing builds.
  • With every build cached the test took 1.4s to 15.2s. Every run slower than that was executing builds.
  • This is a strong correlation, not a proven mechanism: a few jobs with builds running were still fast.

The test also had no handling for a writer process that dies, so it could only fail by timing out. It now fails at once with the exit code and stderr, and any failure prints how far each writer got.

4. Community-world lanes

These are third-party packages, last published in February, and already non-blocking. Three of the last six pushes to stable still concluded cancelled because a lane ran into the job timeout, which continue-on-error does not absorb.

Cause Whose Fix
No bound below the job timeout ours 15 minute step timeout under a 25 minute job timeout, so an overrun fails instead of cancelling the run
Turso: relative file: database path, so the test process opened a second, empty database (no such table) ours absolute path
Worlds were not started or preflighted before the suite ours start and preflight every world
MongoDB ran standalone, without the change streams the world needs to deliver chunks across processes ours single-node replica set
All three packages ignore { timeoutSeconds: 0 } from a flow handler, so affected tests wait out their 60–120s deadlines theirs those tests are left out through a knownGaps entry per world, reported as skipped with the reason

5. Nitro and the Python workbench

See #5682 for the Nitro diagnosis; the patch and its removal condition are the same. The Python workbench exists only on main, but its Vercel project builds every branch and failed on "Root Directory does not exist".

Not fixed here

  • The astro lane's other failure (stepFunctionPassingWorkflow on 0acc0ddf5) was a 503 on the queue push with redelivery about five minutes later. That is on the platform side and can still fail the lane.
  • Vercel Security Review flags the tag-pinned GitHub Actions already on stable; that is being handled separately.

How did you test your changes?

Core

  • New tests in step-streams.test.ts, step-handler.test.ts, flushable-stream.test.ts, serialization.test.ts and flushable-stream-source-error.test.ts. They cover awaited and un-awaited writes, held writers, closes, a step that throws, a backend that hangs (bounded) and one that fails (logged).
  • Neutralising the settle wait turns the new tests red.
  • Whole @workflow/core unit suite: 54 files, 982 tests pass. tsc clean.
  • Not run: the e2e suite locally (not enough free disk for a workbench build) and world-postgres. This PR's e2e lanes are the first end-to-end run.

Unit job and forked-writers test

  • stream-chunk-place.test.ts: 8 tests pass. Making the child exit or throw fails the test in about a second with the exit code and stderr.
  • A turbo dry run shows all 27 build tasks in the test graph have the same hash in the new build step, so the test step replays them from cache.
  • The new step has not run on Windows yet.

Community-world lanes

  • On the first push of this PR, MongoDB and Redis ended failure and the Tests run concluded success, which is the bound working.
  • The other lane changes have never run in CI. The MongoDB replica-set step is only syntax-checked. Expect an iteration on this PR's run; a failure there cannot cancel or fail the run.

Nitro and Python

  • On the first push of this PR the express and fastify Vercel lanes passed, and the workbench-python-workflow status no longer reports a failed deployment.

PR Checklist - Required to merge

  • 📦 pnpm changeset was run to create a changelog for this PR (two @workflow/core patches, plus an empty one for the workbench and CI changes)
  • 🔒 DCO sign-off passes (run git commit --signoff on your commits)
  • 📝 Ping @vercel/workflow in a comment once the PR is ready, and the above checklist is complete

Written by Claude Fable 5.2

🤖 Generated with Claude Code

…nic red lanes

Nitro's Vercel node entry redefines req.socket.remoteAddress on every
request without configurable: true, so a reused socket throws and the
express and fastify workbench deployments answer 500. Patch it.

Also: give the forked-writers world-local test room on Windows, fail
(rather than cancel) a community-world lane that hangs, and stop the
Python workbench project from deploying a branch without that app.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
@pranaygp
pranaygp requested review from a team and ijjk as code owners November 23, 2026 21:16
@vercel

vercel Bot commented Nov 23, 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 Nov 23, 2026 11:23pm UTC
example-nextjs-workflow-webpack Ready Ready Preview, v0 Nov 23, 2026 11:23pm UTC
example-workflow Ready Ready Preview, v0 Nov 23, 2026 11:23pm UTC
workbench-astro-workflow Ready Ready Preview, v0 Nov 23, 2026 11:23pm UTC
workbench-express-workflow Ready Ready Preview, v0 Nov 23, 2026 11:23pm UTC
workbench-fastify-workflow Ready Ready Preview, v0 Nov 23, 2026 11:23pm UTC
workbench-hono-workflow Ready Ready Preview, v0 Nov 23, 2026 11:23pm UTC
workbench-nestjs-workflow Ready Ready Preview, v0 Nov 23, 2026 11:23pm UTC
workbench-nitro-workflow Ready Ready Preview, v0 Nov 23, 2026 11:23pm UTC
workbench-nuxt-workflow Ready Ready Preview, v0 Nov 23, 2026 11:23pm UTC
workbench-sveltekit-workflow Ready Ready Preview, v0 Nov 23, 2026 11:23pm UTC
workbench-tanstack-start-workflow Ready Ready Preview, v0 Nov 23, 2026 11:23pm UTC
workbench-vite-workflow Ready Ready Preview, v0 Nov 23, 2026 11:23pm UTC
workflow-docs Ready Ready Preview, v0 Nov 23, 2026 11:23pm UTC
workflow-swc-playground Ready Ready Preview, v0 Nov 23, 2026 11:23pm UTC
workflow-tarballs Ready Ready Preview, v0 Nov 23, 2026 11:23pm UTC
workflow-web Ready Ready Preview, v0 Nov 23, 2026 11:23pm UTC

Copilot AI balanced review requested due to automatic review settings November 23, 2026 21:16
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

❌ Some tests failed

Summary

Passed Failed Skipped Total
✅ ▲ Vercel Production 1110 0 78 1188
✅ 💻 Local Development 1210 0 86 1296
✅ 📦 Local Production 1210 0 86 1296
✅ 🐘 Local Postgres 1210 0 86 1296
✅ 🪟 Windows 108 0 0 108
❌ 🌍 Community Worlds 212 36 40 288
✅ 📋 Other 612 0 36 648
Total 5672 36 412 6120

❌ Failed Tests

🌍 Community Worlds (36 failed)

mongodb (12 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01M85BHAT1KK6Z3QVK0CHWTQPV
  • webhookWorkflow | wrun_01M85BHFYCCMVWS01C4J63SZYS
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01M85BHQAX9M9V94RDB6KN8TSD
  • sleepingWorkflow | wrun_01M85BJZXJTNHE80AB30NYD3PS
  • outputStreamWorkflow negative startIndex (reads from end)
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns correct index after stream completes
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns -1 before any chunks are written
  • outputStreamWorkflow - getTailIndex and getStreamChunks getStreamChunks returns same content as reading the stream
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01M85BWDZMD2JSENKTB2A676NM
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01M85BYBXKBBRJRFMTGV363WTN
  • pages router sleepingWorkflow via pages router
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01M85C3HNFJXBV3PS329HBY6QT

redis (12 failed):

  • hookWorkflow | wrun_01M85BH3QHHWFZ41TD5A51NJ9P
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01M85BHAT1KK6Z3QVK0CHWTQPV
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01M85BHQAX9M9V94RDB6KN8TSD
  • sleepingWorkflow | wrun_01M85BJZXJTNHE80AB30NYD3PS
  • outputStreamWorkflow negative startIndex (reads from end)
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns correct index after stream completes
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns -1 before any chunks are written
  • outputStreamWorkflow - getTailIndex and getStreamChunks getStreamChunks returns same content as reading the stream
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01M85BWDZMD2JSENKTB2A676NM
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01M85BYBXKBBRJRFMTGV363WTN
  • pages router sleepingWorkflow via pages router
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01M85C3HNFJXBV3PS329HBY6QT

turso (12 failed):

  • hookWorkflow is not resumable via public webhook endpoint | wrun_01M85BHAT1KK6Z3QVK0CHWTQPV
  • sleepingWorkflow | wrun_01M85BJZXJTNHE80AB30NYD3PS
  • outputStreamWorkflow negative startIndex (reads from end)
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns correct index after stream completes
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns -1 before any chunks are written
  • outputStreamWorkflow - getTailIndex and getStreamChunks getStreamChunks returns same content as reading the stream
  • 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
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01M85BWDZMD2JSENKTB2A676NM
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01M85BYBXKBBRJRFMTGV363WTN
  • pages router sleepingWorkflow via pages router
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01M85C3HNFJXBV3PS329HBY6QT

Details by Category

✅ ▲ Vercel Production
App Passed Failed Skipped
✅ astro 100 0 8
✅ example 100 0 8
✅ express 100 0 8
✅ fastify 100 0 8
✅ hono 100 0 8
✅ nextjs-turbopack 105 0 3
✅ nextjs-webpack 105 0 3
✅ nitro 100 0 8
✅ nuxt 100 0 8
✅ sveltekit 100 0 8
✅ vite 100 0 8
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 102 0 6
✅ express-stable 102 0 6
✅ fastify-stable 102 0 6
✅ hono-stable 102 0 6
✅ nextjs-turbopack-canary 89 0 19
✅ nextjs-turbopack-stable 108 0 0
✅ nextjs-webpack-canary 89 0 19
✅ nextjs-webpack-stable 108 0 0
✅ nitro-stable 102 0 6
✅ nuxt-stable 102 0 6
✅ sveltekit-stable 102 0 6
✅ vite-stable 102 0 6
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 102 0 6
✅ express-stable 102 0 6
✅ fastify-stable 102 0 6
✅ hono-stable 102 0 6
✅ nextjs-turbopack-canary 89 0 19
✅ nextjs-turbopack-stable 108 0 0
✅ nextjs-webpack-canary 89 0 19
✅ nextjs-webpack-stable 108 0 0
✅ nitro-stable 102 0 6
✅ nuxt-stable 102 0 6
✅ sveltekit-stable 102 0 6
✅ vite-stable 102 0 6
✅ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 102 0 6
✅ express-stable 102 0 6
✅ fastify-stable 102 0 6
✅ hono-stable 102 0 6
✅ nextjs-turbopack-canary 89 0 19
✅ nextjs-turbopack-stable 108 0 0
✅ nextjs-webpack-canary 89 0 19
✅ nextjs-webpack-stable 108 0 0
✅ nitro-stable 102 0 6
✅ nuxt-stable 102 0 6
✅ sveltekit-stable 102 0 6
✅ vite-stable 102 0 6
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 108 0 0
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 4 0 3
❌ mongodb 68 12 9
✅ redis-dev 4 0 3
❌ redis 68 12 9
✅ turso-dev 4 0 3
❌ turso 64 12 13
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 102 0 6
✅ e2e-local-dev-tanstack-start-stable 102 0 6
✅ e2e-local-postgres-nest-stable 102 0 6
✅ e2e-local-postgres-tanstack-start-stable 102 0 6
✅ e2e-local-prod-nest-stable 102 0 6
✅ e2e-local-prod-tanstack-start-stable 102 0 6

📋 View full workflow run

@changeset-bot

changeset-bot Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 81922b5

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

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

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

pranaygp and others added 2 commits November 23, 2026 17:20
…ty-world overruns

Unit job: build packages in their own step, so a turbo cache miss no
longer runs package builds alongside the test suites on a 4-core
runner. The forked-writers test keeps its 30s budget and now fails at
once, with the exit code and stderr, when a writer process dies.

Community-world lanes: give Turso an absolute database path, start and
preflight every world, run MongoDB as a replica set, leave out tests
that depend on a contract the published packages do not implement, and
bound the E2E step below the job timeout.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
A step wrote step_completed without waiting for the stream writes it
had requested, and request.respondWith() resolved before its Response
reached the server. When the run then completed first, the server
refused the late write and the webhook handler waited out its 120s
stream limit. The step now waits, bounded at 30s and log-only, for the
writes requested so far.

Also abort the sink when a flushable pipe's source read fails, so the
reader rejects instead of staying pending.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Pranay Prakash <pranay.gp@gmail.com>
@pranaygp pranaygp changed the title Fix CI on stable: patch Nitro's remoteAddress crash, quiet three chronic red lanes Fix CI on stable: step stream writes, unit-job builds, community-world lanes, Nitro remoteAddress crash Nov 23, 2026

This branch was successfully deployed

1 active deployment
Preview – workflow-docs — 81922b5d Deployed Nov 23, 2026 by vercel[bot]
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