Skip to content

Commit e7e47fa

Browse files
committed
fix(ssh): restore user PATH for remote servers
1 parent bab4b6f commit e7e47fa

5 files changed

Lines changed: 13 additions & 14 deletions

File tree

‎apps/server/src/provider/Layers/ClaudeProvider.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ export const checkClaudeProviderStatus = Effect.fn("checkClaudeProviderStatus")(
862862
status: "error",
863863
auth: { status: "unknown" },
864864
message: isCommandMissingCause(error)
865-
? "Claude Agent CLI (`claude`) is not installed or not on PATH."
865+
? "Claude Agent CLI (`claude`) was not found on PATH."
866866
: "Failed to execute Claude Agent CLI health check.",
867867
},
868868
});

‎apps/server/src/provider/Layers/CodexProvider.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ export const checkCodexProviderStatus = Effect.fn("checkCodexProviderStatus")(fu
570570
auth: { status: "unknown" },
571571
message: installed
572572
? `Codex app-server provider probe failed: ${error.message}.`
573-
: "Codex CLI (`codex`) is not installed or not on PATH.",
573+
: "Codex CLI (`codex`) was not found on PATH.",
574574
},
575575
});
576576
}

‎apps/server/src/provider/Layers/ProviderRegistry.test.ts‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, ServerSettingsModule.layerTest(), Te
494494
assert.strictEqual(status.status, "error");
495495
assert.strictEqual(status.installed, false);
496496
assert.strictEqual(status.auth.status, "unknown");
497-
assert.strictEqual(
498-
status.message,
499-
"Codex CLI (`codex`) is not installed or not on PATH.",
500-
);
497+
assert.strictEqual(status.message, "Codex CLI (`codex`) was not found on PATH.");
501498
}),
502499
);
503500

@@ -1462,7 +1459,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, ServerSettingsModule.layerTest(), Te
14621459
assert.strictEqual(codexPersonal?.installed, false);
14631460
assert.strictEqual(
14641461
codexPersonal?.message,
1465-
"Codex CLI (`codex`) is not installed or not on PATH.",
1462+
"Codex CLI (`codex`) was not found on PATH.",
14661463
);
14671464
}).pipe(Effect.provide(runtimeServices));
14681465
}),
@@ -2252,10 +2249,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, ServerSettingsModule.layerTest(), Te
22522249
assert.strictEqual(status.status, "error");
22532250
assert.strictEqual(status.installed, false);
22542251
assert.strictEqual(status.auth.status, "unknown");
2255-
assert.strictEqual(
2256-
status.message,
2257-
"Claude Agent CLI (`claude`) is not installed or not on PATH.",
2258-
);
2252+
assert.strictEqual(status.message, "Claude Agent CLI (`claude`) was not found on PATH.");
22592253
}).pipe(Effect.provide(failingSpawnerLayer("spawn claude ENOENT"))),
22602254
);
22612255

‎packages/ssh/src/tunnel.test.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,15 +243,20 @@ describe("ssh tunnel scripts", () => {
243243
username: "julius",
244244
port: 2222,
245245
} as const;
246-
const spawner = ChildProcessSpawner.make(() =>
247-
Effect.succeed(makeSuccessfulProcess('loaded nvm default\n{"remotePort":3774}\n')),
246+
const spawnedCommands: Array<ReadonlyArray<string>> = [];
247+
const spawner = ChildProcessSpawner.make((command) =>
248+
Effect.sync(() => {
249+
spawnedCommands.push(commandArgs(command));
250+
return makeSuccessfulProcess('loaded nvm default\n{"remotePort":3774}\n');
251+
}),
248252
);
249253
const spawnerLayer = Layer.succeed(ChildProcessSpawner.ChildProcessSpawner, spawner);
250254
const processLayer = Layer.merge(NodeServices.layer, spawnerLayer);
251255

252256
return Effect.gen(function* () {
253257
const result = yield* launchOrReuseRemoteServer(target);
254258
assert.equal(result.remotePort, 3774);
259+
assert.deepEqual(spawnedCommands[0]?.slice(-5, -1), ["sh", "-l", "-s", "--"]);
255260
}).pipe(Effect.provide(processLayer));
256261
});
257262

‎packages/ssh/src/tunnel.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ export const launchOrReuseRemoteServer = Effect.fn("ssh/tunnel.launchOrReuseRemo
724724
stateKey: remoteStateKey(target),
725725
});
726726
const result = yield* runSshCommand(target, {
727-
remoteCommandArgs: ["sh", "-s", "--", remoteStateKey(target)],
727+
remoteCommandArgs: ["sh", "-l", "-s", "--", remoteStateKey(target)],
728728
stdin: buildRemoteLaunchScript(runner),
729729
timeoutMs: REMOTE_LAUNCH_TIMEOUT_MS,
730730
...(input?.authSecret === undefined ? {} : { authSecret: input.authSecret }),

0 commit comments

Comments
 (0)