Skip to content

feat(server): typed no-execution-plane environment for workerd profile - #42113

Merged
kitlangton merged 4 commits into
v2from
workerd-environment-fallback
Aug 12, 2026
Merged

feat(server): typed no-execution-plane environment for workerd profile#42113
kitlangton merged 4 commits into
v2from
workerd-environment-fallback

Conversation

@kitlangton

@kitlangtonkitlangton commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

What

Complete the workerd profile's capability story after #41918 and #42076: a bare location now has a typed no-execution-plane process spawner instead of profile-level process stubs.

Shell and stdio MCP route through the location Environment. Bare locations fail each operation with a clear location-specific error; attaching a workspace driver automatically supplies the execution plane without changing the profile.

How

  • Add EnvironmentUnavailable in packages/core/src/environment/unavailable.ts. Its ChildProcessSpawner fails with Effect's typed PlatformError channel and the message: This location has no execution plane: no workspace is attached and the host cannot spawn processes.
  • Replace the workerd profile's cross-spawn implementation with that layer and remove the hand-written Shell.Service replacement, allowing the standard location-scoped Shell service to build.
  • Settle Shell spawn failures through Shell.create instead of swallowing them in its managing fiber.
  • Lazily initialize Shell output storage only after a process spawns, so bare workerd locations do not import filesystem modules or create unused output directories.
  • Retire the mcp.stdio capability flag from core, server options, routes, and the workerd profile. Local MCP servers now attempt connection through Environment.spawner and record the no-plane error as failed.
  • Add core coverage for the typed spawner and MCP failed status, plus a real-workerd regression proving a failed Session shell operation releases session state and permits a later turn.
flowchart TD
L[Location] --> W{workspace attached?}
W -->|yes| D[Workspace driver]
W -->|no| H[Host spawner]
H -->|workerd| N[No-execution-plane spawner]
D --> E[Environment.spawner]
N --> E
E --> S[Shell]
E --> M[stdio MCP]
N --> F[Typed per-operation PlatformError]
Loading

Scope

Testing

  • bun install
  • bun typecheck in packages/core
  • bun typecheck in packages/server
  • bun run test test/mcp.test.ts test/environment.test.ts test/tool-shell.test.ts in packages/core (69 pass, 9 skip)
  • bun run test in packages/workerd-spike (6 pass, real workerd isolate)
  • bun run probe:workerd in packages/server (bundle probe OK, 29.9 MiB)
  • Push hook: bun turbo typecheck --concurrency=3 (32 tasks passed)

@kitlangton
kitlangton enabled auto-merge (squash) August 12, 2026 18:44
@kitlangton
kitlangton merged commit 2025ed9 into v2Aug 12, 2026
11 of 12 checks passed
@kitlangton
kitlangton deleted the workerd-environment-fallback branch August 12, 2026 19:28
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@kitlangton