Description
When configuring an SSH remote for agent execution, Maestro fails to detect installed agents on the remote host if the agent binary is not in the default PATH of the SSH non-login shell. This is common because:
- SSH command execution (
ssh host 'which claude') uses a non-login, non-interactive shell which loads a minimal PATH (typically /usr/bin:/bin)
- Agent binaries are typically installed in user-local directories like
~/.local/bin, ~/.claude/local/, or ~/go/bin/ which are only added to PATH by login shell profiles (.bashrc, .profile, .zshrc)
- The current
detectAgentsRemote() implementation relies solely on which <binary> — when this fails, the agent is marked as "Not Found" even though it's installed and usable
Steps to Reproduce
- Configure an SSH remote in Maestro (Settings → SSH Remotes)
- Install an agent (e.g., Claude Code) on the remote host at
~/.local/bin/claude
- Ensure
~/.local/bin is only added to PATH in .bashrc or .profile (standard installation)
- Open "Create New Agent" modal and select the SSH remote
- Observe that the agent shows "Not Found" despite being installed
Expected Behavior
Maestro should detect the agent as available on the remote host, regardless of whether the SSH non-login shell's PATH includes the installation directory.
Actual Behavior
Agent shows "Not Found" in the agent picker. The logs show:
[INFO] [AgentDetector] Agent "Claude Code" not found on remote host
The which claude command returns exit code 1 because the non-login SSH shell doesn't have ~/.local/bin in PATH.
Root Cause
detectAgentsRemote() in src/main/ipc/handlers/agents.ts uses only which <binaryName> to locate agents. Non-login SSH shells have a restricted PATH that excludes common user-local installation directories.
Description
When configuring an SSH remote for agent execution, Maestro fails to detect installed agents on the remote host if the agent binary is not in the default
PATHof the SSH non-login shell. This is common because:ssh host 'which claude') uses a non-login, non-interactive shell which loads a minimal PATH (typically/usr/bin:/bin)~/.local/bin,~/.claude/local/, or~/go/bin/which are only added to PATH by login shell profiles (.bashrc,.profile,.zshrc)detectAgentsRemote()implementation relies solely onwhich <binary>— when this fails, the agent is marked as "Not Found" even though it's installed and usableSteps to Reproduce
~/.local/bin/claude~/.local/binis only added to PATH in.bashrcor.profile(standard installation)Expected Behavior
Maestro should detect the agent as available on the remote host, regardless of whether the SSH non-login shell's PATH includes the installation directory.
Actual Behavior
Agent shows "Not Found" in the agent picker. The logs show:
The
which claudecommand returns exit code 1 because the non-login SSH shell doesn't have~/.local/binin PATH.Root Cause
detectAgentsRemote()insrc/main/ipc/handlers/agents.tsuses onlywhich <binaryName>to locate agents. Non-login SSH shells have a restricted PATH that excludes common user-local installation directories.