Skip to content

feat(dev): isolate requests in parent-owned workers#760

Closed
ctgowrie wants to merge 4 commits into
mainfrom
feat/dev-parent-worker-transport
Closed

feat(dev): isolate requests in parent-owned workers#760
ctgowrie wants to merge 4 commits into
mainfrom
feat/dev-parent-worker-transport

Conversation

@ctgowrie

Copy link
Copy Markdown
Collaborator

Why

Nitro currently owns both the public dev listener and its reloadable runtime. Replacing that runtime can reset admitted HTTP or WebSocket traffic, lose the original client address, and make shutdown wait on streams whose producer has not stopped.

What changed

  • Keep one parent-owned listener while ready-gated worker candidates move through candidate, active, retired, and closed states.
  • Bind each admission to one worker and the latest published artifact generation; release leases idempotently on finish, error, disconnect, cancellation, and shutdown.
  • Propagate cancellation in both directions and stop workers, active streams, and sockets before awaiting listener closure.
  • Move runtime-artifact control requests into the parent so candidate replacement cannot reset them.
  • Pass client addresses through signed parent-to-worker metadata, strip that metadata before authored HTTP and WebSocket handlers, and reject spoofed values.
  • Vendor the internal worker transport implementation so eve gains no runtime dependency.

Validation

  • Unit: 448 files; 4,689 passed, 1 skipped.
  • Integration: 62 files; 440 passed.
  • Scenario: 53 files; 311 passed, 15 skipped.
  • Focused packaged dev scenarios cover ready replacement, retained WebSockets, runtime-generation HMR, startup-generation pruning, streamed turns, and absence of ECONNRESET/socket-hang-up logs.
  • Formatting, lint, workspace typecheck, and invariant guard pass.

Stack

Depends on #759 (immutable generation artifacts). Stage 4 will make watcher, pointer, route, and worker promotion one transaction. Stage 5 will move the local Workflow World and queue ownership into the parent and add durable generation references plus pruning.

@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
eve-docs Ready Ready Preview, Comment, Open in v0 Jul 14, 2026 2:06pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
eve-docs-1644 Skipped Skipped Open in v0 Jul 14, 2026 2:06pm
eve-docs-4759 Skipped Skipped Open in v0 Jul 14, 2026 2:06pm

@ctgowrie ctgowrie force-pushed the feat/dev-parent-worker-transport branch from feaf376 to 135761c Compare July 14, 2026 12:26
@vercel vercel Bot temporarily deployed to Preview – eve-docs-1644 July 14, 2026 12:26 Inactive
@vercel vercel Bot temporarily deployed to Preview – eve-docs-4759 July 14, 2026 12:26 Inactive
@vercel vercel Bot temporarily deployed to Preview – eve-docs-4759 July 14, 2026 12:31 Inactive
@vercel vercel Bot temporarily deployed to Preview – eve-docs-1644 July 14, 2026 12:31 Inactive
@ctgowrie ctgowrie force-pushed the feat/dev-generation-artifacts branch from 1a5e322 to c0c3030 Compare July 14, 2026 13:23
@ctgowrie ctgowrie force-pushed the feat/dev-parent-worker-transport branch from 0974216 to b80e5e1 Compare July 14, 2026 13:23
@ctgowrie ctgowrie force-pushed the feat/dev-parent-worker-transport branch from b80e5e1 to 4e2aafa Compare July 14, 2026 13:34
@ctgowrie ctgowrie force-pushed the feat/dev-generation-artifacts branch from c0c3030 to 4d02fe3 Compare July 14, 2026 13:34
@vercel vercel Bot temporarily deployed to Preview – eve-docs-1644 July 14, 2026 13:34 Inactive
@vercel vercel Bot temporarily deployed to Preview – eve-docs-4759 July 14, 2026 13:34 Inactive
ctgowrie added 4 commits July 14, 2026 10:03
Signed-off-by: Casey Gowrie <ctgowrie@gmail.com>
Third-party dependencies inlined into a generation bundle can import
`@workflow/*` (e.g. `@ai-sdk/provider-utils` -> `@workflow/serde`). eve
vendors those packages, so leaving the import external emits a bare
specifier no materialized generation can resolve. Externalize workflow
runtime imports only for authored importers and inline them inside
bundled node_modules code.

Also exclude the channel identity plugin from generation bundles so an
immutable artifact structurally cannot read the process-global channel
cache, and split the package boundary plugins into their own module.

Signed-off-by: Casey Gowrie <ctgowrie@gmail.com>
Signed-off-by: Casey Gowrie <ctgowrie@gmail.com>
…s exchange exists

A throw between admission and exchange construction left the lease
held with no socket listener to release it, so a retired worker with
that lease could never close.

Signed-off-by: Casey Gowrie <ctgowrie@gmail.com>
@ctgowrie ctgowrie force-pushed the feat/dev-generation-artifacts branch from 4d02fe3 to 9535d97 Compare July 14, 2026 14:04
@ctgowrie ctgowrie force-pushed the feat/dev-parent-worker-transport branch from 4e2aafa to 7dec777 Compare July 14, 2026 14:04
@vercel vercel Bot temporarily deployed to Preview – eve-docs-4759 July 14, 2026 14:05 Inactive
@vercel vercel Bot temporarily deployed to Preview – eve-docs-1644 July 14, 2026 14:05 Inactive
Base automatically changed from feat/dev-generation-artifacts to main July 14, 2026 18:28
@ctgowrie ctgowrie closed this Jul 15, 2026
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.

1 participant