Skip to content
TypeScript

[codex] Avoid shell for Node executable spawns (#2952)

Julius Marmingea74dfd4f3c06
diff --git a/apps/server/scripts/cli.ts b/apps/server/scripts/cli.ts
index 63a8d1e9fa8..65f99505a8c 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 88ec189a1fd..aca87d45c62 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 385006078f4..093d4acfcfa 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<string, string>) =>
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 c8da7b18a14..77b5a163559 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);
});