Add SSH-based remote agent support#51
Open
itslijohnny wants to merge 1 commit into
Open
Conversation
ACP only speaks JSON-RPC over stdio, so there's no way to point the
extension at an agent (e.g. Hermes Agent) running on another machine.
Add an optional `remote: { host, user?, port?, identityFile? }` block
to acp.agents entries: when set, command/args are launched over `ssh`
instead of locally, tunneling the agent's stdio.
Docs updated per Hermes's own ACP docs
(https://hermes-agent.nousresearch.com/docs/user-guide/features/acp),
which confirm the agent side has no built-in network transport either.
Author
|
adding new remode agent |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds optional SSH tunneling so ACP agents (JSON-RPC over stdio) can be spawned on a remote machine while keeping stdio connected to the extension locally.
Changes:
- Introduces
remote: { host, user?, port?, identityFile? }onacp.agentsentries and spawns agents viasshwhen set. - Updates configuration typing + VS Code settings schema to expose the new
remoteblock. - Documents remote-agent usage, requirements, and limitations; adds a changelog entry.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/core/AgentManager.ts | Adds SSH-based spawning path and helpers for remote agent invocation. |
| src/config/AgentConfig.ts | Extends agent config types with a remote SSH target interface. |
| README.md | Documents remote agent configuration and limitations. |
| package.json | Updates acp.agents settings schema to include remote fields. |
| CHANGELOG.md | Adds an Unreleased changelog entry for SSH remote agents. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| */ | ||
| function buildRemoteSshInvocation(config: AgentConfigEntry): { command: string; args: string[] } { | ||
| const remote = config.remote!; | ||
| const sshArgs: string[] = ['-o', 'BatchMode=yes', '-o', 'StrictHostKeyChecking=accept-new']; |
| } | ||
|
|
||
| const target = remote.user ? `${remote.user}@${remote.host}` : remote.host; | ||
| sshArgs.push(target); |
Comment on lines
+96
to
+97
| const remoteCommandStr = [config.command, ...(config.args || [])].map(shellEscape).join(' '); | ||
| sshArgs.push(`bash -lc ${shellEscape(remoteCommandStr)}`); |
Comment on lines
+78
to
+80
| * The remote command runs through `bash -lc` so the remote user's login | ||
| * profile (nvm, pyenv, venvs, etc.) is sourced — mirroring the local-spawn | ||
| * behavior below. |
Comment on lines
+67
to
+69
| if (path.startsWith('~/')) { | ||
| return join(homedir(), path.slice(2)); | ||
| } |
| Requirements: | ||
| - Passwordless SSH access to the host (key-based auth — there's no interactive password prompt support). | ||
| - `hermes` on the remote account's `PATH`, with credentials already configured there (`hermes model`) — see the [Hermes ACP docs](https://hermes-agent.nousresearch.com/docs/user-guide/features/acp) for installing/configuring Hermes itself. | ||
| - The remote command runs via a login shell (`bash -lc`) so `PATH` picks up nvm/pyenv/venv entries from the remote profile, same as local agents. |
Comment on lines
+314
to
+317
| "port": { | ||
| "type": "number", | ||
| "description": "SSH port. Omit to use the default (22) or ssh config." | ||
| }, |
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.
ACP only speaks JSON-RPC over stdio, so there's no way to point the extension at an agent (e.g. Hermes Agent) running on another machine. Add an optional
remote: { host, user?, port?, identityFile? }block to acp.agents entries: when set, command/args are launched oversshinstead of locally, tunneling the agent's stdio.Docs updated per Hermes's own ACP docs
(https://hermes-agent.nousresearch.com/docs/user-guide/features/acp), which confirm the agent side has no built-in network transport either.