From a74dfd4f3c06e5028b43af51d2e35139f7ac2c00 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Thu, 4 Jun 2026 15:14:07 -0700 Subject: [PATCH] [codex] Avoid shell for Node executable spawns (#2952) Co-authored-by: Julius Marminge --- apps/server/scripts/cli.ts | 2 -- packages/effect-acp/src/client.test.ts | 3 +-- packages/effect-acp/src/protocol.test.ts | 3 +-- packages/effect-codex-app-server/src/client.test.ts | 3 +-- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/apps/server/scripts/cli.ts b/apps/server/scripts/cli.ts index 63a8d1e9fa8d4ac2e8b056765f24756f32d03804..65f99505a8cb8ff9f214ba8d4ed665722c5e47f9 100644 --- a/apps/server/scripts/cli.ts +++ b/apps/server/scripts/cli.ts @@ -175,8 +175,6 @@ const buildCmd = Command.make( cwd: serverDir, stdout: config.verbose ? "inherit" : "ignore", stderr: "inherit", - // Windows needs shell mode to resolve `.cmd` shims on PATH. - shell: process.platform === "win32", }), ); diff --git a/packages/effect-acp/src/client.test.ts b/packages/effect-acp/src/client.test.ts index 88ec189a1fd0b09e1a6c9718ff551f200ea4f7ee..aca87d45c627fb87f3343d4d0f7cdf4e9c1b984b 100644 --- a/packages/effect-acp/src/client.test.ts +++ b/packages/effect-acp/src/client.test.ts @@ -34,9 +34,8 @@ it.layer(NodeServices.layer)("effect-acp client", (it) => { Effect.gen(function* () { const spawner = yield* ChildProcessSpawner.ChildProcessSpawner; const path = yield* Path.Path; - const command = ChildProcess.make("node", mockPeerArgs(yield* mockPeerPath), { + const command = ChildProcess.make(process.execPath, mockPeerArgs(yield* mockPeerPath), { cwd: path.join(import.meta.dirname, ".."), - shell: process.platform === "win32", ...(env ? { env: { ...process.env, ...env } } : {}), }); return yield* spawner.spawn(command); diff --git a/packages/effect-acp/src/protocol.test.ts b/packages/effect-acp/src/protocol.test.ts index 385006078f45b6d7daadffc8a2f32abeef862de3..093d4acfcfa2725341db53d10cf4220028d9776b 100644 --- a/packages/effect-acp/src/protocol.test.ts +++ b/packages/effect-acp/src/protocol.test.ts @@ -57,9 +57,8 @@ const makeHandle = (env?: Record) => Effect.gen(function* () { const spawner = yield* ChildProcessSpawner.ChildProcessSpawner; const path = yield* Path.Path; - const command = ChildProcess.make("node", mockPeerArgs(yield* mockPeerPath), { + const command = ChildProcess.make(process.execPath, mockPeerArgs(yield* mockPeerPath), { cwd: path.join(import.meta.dirname, ".."), - shell: process.platform === "win32", ...(env ? { env: { ...process.env, ...env } } : {}), }); return yield* spawner.spawn(command); diff --git a/packages/effect-codex-app-server/src/client.test.ts b/packages/effect-codex-app-server/src/client.test.ts index c8da7b18a140cf0ee99cb0231447d4562b423ba7..77b5a163559fe0a942bb958a4b09dea0018573a8 100644 --- a/packages/effect-codex-app-server/src/client.test.ts +++ b/packages/effect-codex-app-server/src/client.test.ts @@ -22,9 +22,8 @@ it.layer(NodeServices.layer)("effect-codex-app-server client", (it) => { const spawner = yield* ChildProcessSpawner.ChildProcessSpawner; const path = yield* Path.Path; const peerCwd = path.join(import.meta.dirname, ".."); - const command = ChildProcess.make("node", mockPeerArgs(yield* mockPeerPath), { + const command = ChildProcess.make(process.execPath, mockPeerArgs(yield* mockPeerPath), { cwd: peerCwd, - shell: process.platform === "win32", }); return yield* spawner.spawn(command); }); -- 2.54.0