History

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

Julius Marminge committed 5 months ago

Commit a74dfd41 parent 49c1b644 files · +3 −8Browse files

Unified · Split

4 files
  1. apps/server/scripts/cli.ts +0 −2
  2. packages/effect-acp/src/client.test.ts +1 −2
  3. packages/effect-acp/src/protocol.test.ts +1 −2
  4. packages/effect-codex-app-server/src/client.test.ts +1 −2
apps/server/scripts/cli.ts+0−2
@@ -175,8 +175,6 @@ const buildCmd = Command.make( · 174 unmodified lines
175175 cwd: serverDir,
176176 stdout: config.verbose ? "inherit" : "ignore",
177177 stderr: "inherit",
178− // Windows needs shell mode to resolve `.cmd` shims on PATH.
179− shell: process.platform === "win32",
180178 }),
181179 );
182180
packages/effect-acp/src/client.test.ts+1−2
@@ -34,9 +34,8 @@ it.layer(NodeServices.layer)("effect-acp client", (it) => { · 33 unmodified lines
3434 Effect.gen(function* () {
3535 const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
3636 const path = yield* Path.Path;
37− const command = ChildProcess.make("node", mockPeerArgs(yield* mockPeerPath), {
37+ const command = ChildProcess.make(process.execPath, mockPeerArgs(yield* mockPeerPath), {
3838 cwd: path.join(import.meta.dirname, ".."),
39− shell: process.platform === "win32",
4039 ...(env ? { env: { ...process.env, ...env } } : {}),
4140 });
4241 return yield* spawner.spawn(command);
packages/effect-acp/src/protocol.test.ts+1−2
@@ -57,9 +57,8 @@ const makeHandle = (env?: Record<string, string>) => · 56 unmodified lines
5757 Effect.gen(function* () {
5858 const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
5959 const path = yield* Path.Path;
60− const command = ChildProcess.make("node", mockPeerArgs(yield* mockPeerPath), {
60+ const command = ChildProcess.make(process.execPath, mockPeerArgs(yield* mockPeerPath), {
6161 cwd: path.join(import.meta.dirname, ".."),
62− shell: process.platform === "win32",
6362 ...(env ? { env: { ...process.env, ...env } } : {}),
6463 });
6564 return yield* spawner.spawn(command);
packages/effect-codex-app-server/src/client.test.ts+1−2
@@ -22,9 +22,8 @@ it.layer(NodeServices.layer)("effect-codex-app-server client", (it) => { · 21 unmodified lines
2222 const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
2323 const path = yield* Path.Path;
2424 const peerCwd = path.join(import.meta.dirname, "..");
25− const command = ChildProcess.make("node", mockPeerArgs(yield* mockPeerPath), {
25+ const command = ChildProcess.make(process.execPath, mockPeerArgs(yield* mockPeerPath), {
2626 cwd: peerCwd,
27− shell: process.platform === "win32",
2827 });
2928 return yield* spawner.spawn(command);
3029 });

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t