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);