fix: SSH executor uses source ~/.profile for remote PATH

SSH non-interactive sessions don't load .profile, causing 'claude: command not found'.
Prepend 'source ~/.profile 2>/dev/null;' to ensure user PATH is available.

Verified: end-to-end test passed (arm0 → WSL2 Claude Code, 77s execution).
This commit is contained in:
Zer4tul 2026-05-12 16:36:02 +08:00
parent d1a746a8cb
commit 01f5fac718
3 changed files with 12 additions and 2 deletions

View file

@ -130,7 +130,7 @@ impl SshExecutor {
cmd.arg("-i").arg(key);
}
cmd.arg(format!("{}@{}", host.ssh_user, host.hostname))
.arg(command);
.arg(format!("source ~/.profile 2>/dev/null; {command}"));
cmd
};