From 4b1f5c65c3a9e329c89402fdda6b9e61b07b4188 Mon Sep 17 00:00:00 2001 From: mika kuns Date: Fri, 2 Oct 2026 14:36:01 +0200 Subject: [PATCH] fix(worker): put ~/.local/bin on PATH for remote claude in ssh sessions --- src/ClaudeDo.Worker/Runner/InteractiveLaunchSpecService.cs | 3 ++- .../Runner/InteractiveLaunchSpecServiceTests.cs | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ClaudeDo.Worker/Runner/InteractiveLaunchSpecService.cs b/src/ClaudeDo.Worker/Runner/InteractiveLaunchSpecService.cs index de678c8a..967be3c1 100644 --- a/src/ClaudeDo.Worker/Runner/InteractiveLaunchSpecService.cs +++ b/src/ClaudeDo.Worker/Runner/InteractiveLaunchSpecService.cs @@ -335,8 +335,9 @@ public sealed class InteractiveLaunchSpecService var cfgFile = $"~/.claudedo/mcp-{paneId}.json"; // 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 = - $"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)}" + $" && MCP_TOOL_TIMEOUT={McpToolTimeoutMs} claude --mcp-config {cfgFile}; rm -f {cfgFile}"; diff --git a/tests/ClaudeDo.Worker.Tests/Runner/InteractiveLaunchSpecServiceTests.cs b/tests/ClaudeDo.Worker.Tests/Runner/InteractiveLaunchSpecServiceTests.cs index 964e9501..4db1b716 100644 --- a/tests/ClaudeDo.Worker.Tests/Runner/InteractiveLaunchSpecServiceTests.cs +++ b/tests/ClaudeDo.Worker.Tests/Runner/InteractiveLaunchSpecServiceTests.cs @@ -1689,6 +1689,7 @@ public sealed class InteractiveLaunchSpecServiceTests : IDisposable Assert.DoesNotContain(spec.Args, a => a.Contains('"')); var remote = spec.Args[6]; + Assert.StartsWith("export PATH=$HOME/.local/bin:$PATH && ", remote); Assert.Contains("cd ~/'app'", 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);