Skip to content

multi sandbox backen support#223

Merged
vmelikyan merged 1 commit into
mainfrom
wp-provider
Jul 6, 2026
Merged

multi sandbox backen support#223
vmelikyan merged 1 commit into
mainfrom
wp-provider

Conversation

@vmelikyan

Copy link
Copy Markdown
Contributor

No description provided.

@vmelikyan vmelikyan requested a review from a team as a code owner July 5, 2026 00:06
@vmelikyan vmelikyan force-pushed the wp-provider branch 2 times, most recently from f388c79 to 3e6cecd Compare July 5, 2026 00:33
@vmelikyan vmelikyan merged commit ebcb749 into main Jul 6, 2026
9 checks passed
vigneshrajsb added a commit that referenced this pull request Jul 10, 2026
With MCP_SERVER_ENABLED=true, lifecycle-web pods crashed at boot with
"Cannot find module './src/server/mcp/handler'": ws-server.ts loaded the
handler via a deferred require() that sits outside tsc's static import
graph, so `tsc -p tsconfig.server.json` never emitted the module.

The deferred require existed only to keep the ESM-only jose / MCP SDK off
the boot path on Node < 20.19 (require(esm) support). That was valid when
the MCP alphas shipped on node:20-slim, but #223 moved every build to
node:22-slim before this code reached main — and the Docker image welds the
Node runtime to the app code, so "MCP code on Node 20" can't occur. The
workaround now guards an impossible state.

Import the handler statically instead. tsc traces it through ws-server.ts's
import graph and emits it normally, eliminating the build-vs-runtime gap at
the root (no tsconfig "include" entry needed). The MCP_SERVER_ENABLED flag
still gates whether the handler is wired up; only the module load moves to
boot, which is a plain require on Node 22.

Verified: tsc emits .next/src/server/mcp/handler.js via the static graph
(absent before); server typecheck + lint clean.
vigneshrajsb added a commit that referenced this pull request Jul 10, 2026
)

With MCP_SERVER_ENABLED=true, lifecycle-web pods crashed at boot with
"Cannot find module './src/server/mcp/handler'": ws-server.ts loaded the
handler via a deferred require() that sits outside tsc's static import
graph, so `tsc -p tsconfig.server.json` never emitted the module.

The deferred require existed only to keep the ESM-only jose / MCP SDK off
the boot path on Node < 20.19 (require(esm) support). That was valid when
the MCP alphas shipped on node:20-slim, but #223 moved every build to
node:22-slim before this code reached main — and the Docker image welds the
Node runtime to the app code, so "MCP code on Node 20" can't occur. The
workaround now guards an impossible state.

Import the handler statically instead. tsc traces it through ws-server.ts's
import graph and emits it normally, eliminating the build-vs-runtime gap at
the root (no tsconfig "include" entry needed). The MCP_SERVER_ENABLED flag
still gates whether the handler is wired up; only the module load moves to
boot, which is a plain require on Node 22.

Verified: tsc emits .next/src/server/mcp/handler.js via the static graph
(absent before); server typecheck + lint clean.
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