fix(worker): put ~/.local/bin on PATH for remote claude in ssh sessions

This commit is contained in:
mika kuns
2026-10-02 14:36:01 +02:00
parent 2e29e03a8e
commit 4b1f5c65c3
2 changed files with 3 additions and 1 deletions
@@ -335,8 +335,9 @@ public sealed class InteractiveLaunchSpecService
var cfgFile = $"~/.claudedo/mcp-{paneId}.json"; var cfgFile = $"~/.claudedo/mcp-{paneId}.json";
// No double quotes anywhere: ConPTY flattens Args into one Windows command line. // No double quotes anywhere: ConPTY flattens Args into one Windows command line.
// ssh runs a non-interactive shell whose .bashrc bails early, so the native installer's ~/.local/bin is added by hand.
var remote = var remote =
$"umask 077 && mkdir -p ~/.claudedo && echo {b64} | base64 -d > {cfgFile}" + $"export PATH=$HOME/.local/bin:$PATH && umask 077 && mkdir -p ~/.claudedo && echo {b64} | base64 -d > {cfgFile}" +
$" && cd {SshWorkspace.QuoteRemotePath(ws.RemotePath)}" + $" && cd {SshWorkspace.QuoteRemotePath(ws.RemotePath)}" +
$" && MCP_TOOL_TIMEOUT={McpToolTimeoutMs} claude --mcp-config {cfgFile}; rm -f {cfgFile}"; $" && MCP_TOOL_TIMEOUT={McpToolTimeoutMs} claude --mcp-config {cfgFile}; rm -f {cfgFile}";
@@ -1689,6 +1689,7 @@ public sealed class InteractiveLaunchSpecServiceTests : IDisposable
Assert.DoesNotContain(spec.Args, a => a.Contains('"')); Assert.DoesNotContain(spec.Args, a => a.Contains('"'));
var remote = spec.Args[6]; var remote = spec.Args[6];
Assert.StartsWith("export PATH=$HOME/.local/bin:$PATH && ", remote);
Assert.Contains("cd ~/'app'", remote); Assert.Contains("cd ~/'app'", remote);
Assert.Contains($"MCP_TOOL_TIMEOUT={InteractiveLaunchSpecService.McpToolTimeoutMs} claude --mcp-config ~/.claudedo/mcp-{paneId}.json", remote); Assert.Contains($"MCP_TOOL_TIMEOUT={InteractiveLaunchSpecService.McpToolTimeoutMs} claude --mcp-config ~/.claudedo/mcp-{paneId}.json", remote);
Assert.EndsWith($"rm -f ~/.claudedo/mcp-{paneId}.json", remote); Assert.EndsWith($"rm -f ~/.claudedo/mcp-{paneId}.json", remote);