fix: detect npm/nvm-installed agents on SSH remotes#366
Open
chr1syy wants to merge 1 commit intoRunMaestro:mainfrom
Open
fix: detect npm/nvm-installed agents on SSH remotes#366chr1syy wants to merge 1 commit intoRunMaestro:mainfrom
chr1syy wants to merge 1 commit intoRunMaestro:mainfrom
Conversation
SSH remote agent detection and execution used a hardcoded PATH that only included static directories like ~/.local/bin and /usr/local/bin. This meant agents installed via Node version managers (nvm, fnm, volta, mise, asdf, n) were not found on remote hosts. Add dynamic Node version manager PATH detection to the SSH command builder. Both buildSshCommand() and buildSshCommandWithStdin() now probe the remote host for version manager installations and prepend their bin directories to PATH before executing commands. This mirrors the existing local detection logic in pathUtils.ts detectNodeVersionManagerBinPaths() but runs as shell commands on the remote host rather than Node.js filesystem calls. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
~/.nvm/versions/node/v22.21.1/bin/)npmthrough nvm, fnm, volta, mise, asdf, or n were not detected on remote hostsbuildSshCommand()andbuildSshCommandWithStdin(), mirroring the existing local detection logic indetectNodeVersionManagerBinPaths()Details
The SSH command builder in
src/main/utils/ssh-command-builder.tshad a hardcoded PATH that only included static directories:This meant
which codex(used for agent detection) and agent execution both failed on remotes where the agent was installed via npm/nvm into a path like/home/user/.nvm/versions/node/v22.21.1/bin/codex.The fix adds shell snippets that dynamically probe the remote host for version manager installations:
$NVM_DIR/current/bin+ all$NVM_DIR/versions/node/v*/binaliases/default/bin+ allnode-versions/v*/installation/bin~/.volta/bin~/.local/share/mise/shims~/.asdf/shims$N_PREFIX/binTwo variants are provided:
buildNodeVersionManagerPathLines()— multi-line script for stdin-based SSH executionbuildNodeVersionManagerPathSnippet()— compact single-line version forbash -c '...'Test plan
ssh-command-buildertests passssh-remote-resolvertests pass🤖 Generated with Claude Code