Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/desktop/src/shell/DesktopShellEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ const readWindowsEnvironment = Effect.fn("desktop.shellEnvironment.readWindowsEn
const output = yield* runCommandOutput({
command,
args,
shell: true,
timeout: LOGIN_SHELL_TIMEOUT,
});
const environment = extractEnvironment(output, names);
Expand Down
2 changes: 0 additions & 2 deletions apps/server/scripts/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,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",
}),
);

Expand Down
1 change: 0 additions & 1 deletion apps/server/src/diagnostics/ProcessDiagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ const runProcess = Effect.fn("runProcess")(
const child = yield* spawner.spawn(
ChildProcess.make(input.command, input.args, {
cwd: process.cwd(),
shell: process.platform === "win32",
}),
);
const [stdout, stderr, exitCode] = yield* Effect.all(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ const runFriendlyLabelCommand = Effect.fn("runFriendlyLabelCommand")(function* (
command,
args,
timeoutBehavior: "timedOutResult",
shell: process.platform === "win32",
})
.pipe(Effect.option);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const git = (cwd: string, args: ReadonlyArray<string>) =>
return yield* processRunner.run({
command: "git",
args: ["-C", cwd, ...args],
shell: process.platform === "win32",
});
}).pipe(Effect.provide(ProcessRunner.layer));

Expand Down
2 changes: 0 additions & 2 deletions apps/server/src/project/Layers/RepositoryIdentityResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ const resolveRepositoryIdentityCacheKey = Effect.fn("resolveRepositoryIdentityCa
command: "git",
args: ["-C", cwd, "rev-parse", "--show-toplevel"],
timeoutBehavior: "timedOutResult",
shell: process.platform === "win32",
})
.pipe(Effect.option);
if (topLevelResult._tag === "None" || topLevelResult.value.code !== 0) {
Expand All @@ -119,7 +118,6 @@ const resolveRepositoryIdentityFromCacheKey = Effect.fn("resolveRepositoryIdenti
command: "git",
args: ["-C", cacheKey, "remote", "-v"],
timeoutBehavior: "timedOutResult",
shell: process.platform === "win32",
})
.pipe(Effect.option);
if (remoteResult._tag === "None" || remoteResult.value.code !== 0) {
Expand Down
1 change: 0 additions & 1 deletion apps/server/src/terminal/Layers/Manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ function checkWindowsSubprocessActivity(
timeout: "1500 millis",
maxOutputBytes: 32_768,
outputMode: "truncate",
shell: process.platform === "win32",
timeoutBehavior: "timedOutResult",
});
}).pipe(
Expand Down
1 change: 0 additions & 1 deletion packages/effect-acp/src/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ it.layer(NodeServices.layer)("effect-acp client", (it) => {
const path = yield* Path.Path;
const command = ChildProcess.make("bun", ["run", yield* mockPeerPath], {
cwd: path.join(import.meta.dirname, ".."),
shell: process.platform === "win32",
...(env ? { env: { ...process.env, ...env } } : {}),
});
return yield* spawner.spawn(command);
Expand Down
1 change: 0 additions & 1 deletion packages/effect-acp/src/protocol.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ const makeHandle = (env?: Record<string, string>) =>
const path = yield* Path.Path;
const command = ChildProcess.make("bun", ["run", yield* mockPeerPath], {
cwd: path.join(import.meta.dirname, ".."),
shell: process.platform === "win32",
...(env ? { env: { ...process.env, ...env } } : {}),
});
return yield* spawner.spawn(command);
Expand Down
1 change: 0 additions & 1 deletion packages/effect-codex-app-server/src/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ it.layer(NodeServices.layer)("effect-codex-app-server client", (it) => {
const path = yield* Path.Path;
const command = ChildProcess.make("bun", ["run", yield* mockPeerPath], {
cwd: path.join(import.meta.dirname, ".."),
shell: process.platform === "win32",
});
return yield* spawner.spawn(command);
});
Expand Down
20 changes: 10 additions & 10 deletions packages/ssh/src/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { SshCommandError, SshInvalidTargetError } from "./errors.ts";

const PUBLISHABLE_T3_VERSION_PATTERN = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/u;
const DEFAULT_SSH_COMMAND_TIMEOUT_MS = 60_000;
export const SSH_COMMAND = process.platform === "win32" ? "ssh.exe" : "ssh";

const encoder = new TextEncoder();

Expand Down Expand Up @@ -153,7 +154,7 @@ const runSshCommandInScope = Effect.fn("ssh/command.runSshCommand.inScope")(func
Effect.mapError(
(cause) =>
new SshCommandError({
command: ["ssh"],
command: [SSH_COMMAND],
exitCode: null,
stderr: "",
message: "Failed to prepare SSH authentication helpers.",
Expand All @@ -172,15 +173,14 @@ const runSshCommandInScope = Effect.fn("ssh/command.runSshCommand.inScope")(func
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
yield* Effect.logDebug("ssh.command.start", {
...sshTargetLogFields(target),
command: ["ssh", ...args],
command: [SSH_COMMAND, ...args],
Comment thread
coderabbitai[bot] marked this conversation as resolved.
hasStdin: input.stdin !== undefined,
timeoutMs: input.timeoutMs ?? DEFAULT_SSH_COMMAND_TIMEOUT_MS,
});
const child = yield* spawner
.spawn(
ChildProcess.make("ssh", args, {
ChildProcess.make(SSH_COMMAND, args, {
env: environment,
shell: process.platform === "win32",
stdin: {
stream: stdinStream(input.stdin),
endOnDone: true,
Expand All @@ -192,7 +192,7 @@ const runSshCommandInScope = Effect.fn("ssh/command.runSshCommand.inScope")(func
Effect.mapError(
(cause) =>
new SshCommandError({
command: ["ssh", ...args],
command: [SSH_COMMAND, ...args],
exitCode: null,
stderr: "",
message:
Expand All @@ -215,7 +215,7 @@ const runSshCommandInScope = Effect.fn("ssh/command.runSshCommand.inScope")(func
Effect.mapError(
(cause) =>
new SshCommandError({
command: ["ssh", ...args],
command: [SSH_COMMAND, ...args],
exitCode: null,
stderr: "",
message:
Expand All @@ -228,12 +228,12 @@ const runSshCommandInScope = Effect.fn("ssh/command.runSshCommand.inScope")(func
if (exitCode !== 0) {
yield* Effect.logWarning("ssh.command.failed", {
...sshTargetLogFields(target),
command: ["ssh", ...args],
command: [SSH_COMMAND, ...args],
exitCode,
stderr,
});
return yield* new SshCommandError({
command: ["ssh", ...args],
command: [SSH_COMMAND, ...args],
exitCode,
stderr,
message: normalizeSshErrorMessage(
Expand All @@ -245,7 +245,7 @@ const runSshCommandInScope = Effect.fn("ssh/command.runSshCommand.inScope")(func

yield* Effect.logDebug("ssh.command.succeeded", {
...sshTargetLogFields(target),
command: ["ssh", ...args],
command: [SSH_COMMAND, ...args],
});
return { stdout, stderr };
});
Expand Down Expand Up @@ -275,7 +275,7 @@ export const runSshCommand = Effect.fn("ssh/command.runSshCommand")(function* (
hasStdin: input.stdin !== undefined,
});
return yield* new SshCommandError({
command: ["ssh"],
command: [SSH_COMMAND],
exitCode: null,
stderr: "",
message: `SSH command timed out after ${input.timeoutMs ?? DEFAULT_SSH_COMMAND_TIMEOUT_MS}ms.`,
Expand Down
6 changes: 3 additions & 3 deletions packages/ssh/src/tunnel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import {
remoteStateKey,
resolveSshTarget,
runSshCommand,
SSH_COMMAND,
targetConnectionKey,
} from "./command.ts";
import {
Expand Down Expand Up @@ -1138,7 +1139,7 @@ const startSshTunnel = Effect.fn("ssh/tunnel.startSshTunnel")(function* (input:
`${input.localPort}:127.0.0.1:${input.remotePort}`,
hostSpec,
];
const tunnelCommand = ["ssh", ...args];
const tunnelCommand = [SSH_COMMAND, ...args];
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
const scope = yield* Scope.Scope;
yield* Effect.logDebug("ssh.tunnel.spawn.start", {
Expand All @@ -1151,9 +1152,8 @@ const startSshTunnel = Effect.fn("ssh/tunnel.startSshTunnel")(function* (input:
});
const child = yield* spawner
.spawn(
ChildProcess.make("ssh", args, {
ChildProcess.make(SSH_COMMAND, args, {
env: childEnvironment,
shell: process.platform === "win32",
stdin: {
stream: Stream.empty,
endOnDone: true,
Expand Down
13 changes: 3 additions & 10 deletions packages/tailscale/src/tailscale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const DEFAULT_TAILSCALE_SERVE_PORT = 443;
export const TAILSCALE_STATUS_TIMEOUT_MS = 1_500;
export const TAILSCALE_SERVE_TIMEOUT_MS = 10_000;
export const TAILSCALE_PROBE_TIMEOUT_MS = 2_500;
const TAILSCALE_COMMAND = process.platform === "win32" ? "tailscale.exe" : "tailscale";

export class TailscaleCommandError extends Data.TaggedError("TailscaleCommandError")<{
readonly command: readonly string[];
Expand Down Expand Up @@ -133,11 +134,7 @@ export const readTailscaleStatus: Effect.Effect<
const args = ["status", "--json"];
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
const child = yield* spawner
.spawn(
ChildProcess.make("tailscale", args, {
shell: process.platform === "win32",
}),
)
.spawn(ChildProcess.make(TAILSCALE_COMMAND, args))
.pipe(
Effect.mapError((cause) =>
tailscaleCommandError(
Expand Down Expand Up @@ -212,11 +209,7 @@ const runTailscaleCommand = (
Effect.gen(function* () {
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
const child = yield* spawner
.spawn(
ChildProcess.make("tailscale", args, {
shell: process.platform === "win32",
}),
)
.spawn(ChildProcess.make(TAILSCALE_COMMAND, args))
.pipe(
Effect.mapError((cause) =>
tailscaleCommandError(
Expand Down
Loading