Skip to content

Commit 0314b5e

Browse files
committed
fix(mcp): preserve headless namespace in install payload
Pass the isolated runtime namespace to spawned headless clients so the bootstrap process binds the socket that post-spawn discovery polls.
1 parent 18d091c commit 0314b5e

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

apps/daemon/src/mcp-routes.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ export function registerMcpRoutes(app: Express, ctx: RegisterMcpRoutesDeps) {
7070
if (mcpBootstrapIpcPath != null && mcpBootstrapIpcPath.length > 0) {
7171
sidecarEnv.OD_MCP_BOOTSTRAP_IPC_PATH = mcpBootstrapIpcPath;
7272
}
73+
const packagedRuntimeNamespace = process.env.OD_PACKAGED_RUNTIME_NAMESPACE;
74+
if (packagedRuntimeNamespace != null && packagedRuntimeNamespace.length > 0) {
75+
sidecarEnv.OD_PACKAGED_RUNTIME_NAMESPACE = packagedRuntimeNamespace;
76+
}
7377
// tools-dev / packaged launchers export OD_WEB_PORT so the daemon
7478
// knows where the browser-facing OpenDesign studio is running.
7579
// CLI-only / headless launches set neither and webBaseUrl falls

apps/daemon/tests/mcp-install-info.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ function makeInstallInfoApp({ cliPath, port, env = {}, dataDir }: InstallInfoOpt
8888
'OD_MCP_BOOTSTRAP_COMMAND',
8989
'OD_MCP_BOOTSTRAP_ARGS',
9090
'OD_MCP_BOOTSTRAP_IPC_PATH',
91+
'OD_PACKAGED_RUNTIME_NAMESPACE',
9192
] as const) {
9293
const value = env[key];
9394
if (value != null && value.length > 0) sidecarEnv[key] = value;
@@ -327,6 +328,7 @@ describe('GET /api/mcp/install-info', () => {
327328
OD_MCP_BOOTSTRAP_ARGS: bootstrapArgs,
328329
OD_MCP_BOOTSTRAP_IPC_PATH:
329330
'/tmp/open-design/ipc/release-stable-headless/daemon.sock',
331+
OD_PACKAGED_RUNTIME_NAMESPACE: 'release-stable-headless',
330332
},
331333
dataDir,
332334
);
@@ -343,6 +345,7 @@ describe('GET /api/mcp/install-info', () => {
343345
OD_MCP_BOOTSTRAP_ARGS: bootstrapArgs,
344346
OD_MCP_BOOTSTRAP_IPC_PATH:
345347
'/tmp/open-design/ipc/release-stable-headless/daemon.sock',
348+
OD_PACKAGED_RUNTIME_NAMESPACE: 'release-stable-headless',
346349
});
347350
} finally {
348351
await new Promise<void>((done) => server?.close(() => done()));

0 commit comments

Comments
 (0)