agentHost: honor SSH ProxyJump when connecting - #334849
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Host-key alias handling, IPC and artifact cleanup, and localization issues remain unresolved.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds SSH proxy support to Agent Host connections, including native askpass prompting and secure proxy lifecycle handling.
Changes:
- Supports
ProxyJump,ProxyCommand,ProxyUseFdpass, andHostKeyAlias. - Adds native proxy transports and renderer-mediated authentication prompts.
- Adds parsing, security, cleanup, and reconnection tests.
File summaries
| File | Description |
|---|---|
src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostActions.ts |
Forwards resolved proxy configuration. |
src/vs/platform/agentHost/test/node/sshRemoteAgentHostService.test.ts |
Tests proxy transport, askpass, cleanup, and reconnection. |
src/vs/platform/agentHost/test/electron-browser/sshRemoteAgentHostService.test.ts |
Tests renderer prompt handling. |
src/vs/platform/agentHost/test/common/sshConfigParsing.test.ts |
Tests proxy configuration parsing. |
src/vs/platform/agentHost/node/sshRemoteAgentHostService.ts |
Implements proxy transports and askpass IPC. |
src/vs/platform/agentHost/electron-browser/sshRemoteAgentHostServiceImpl.ts |
Presents proxy authentication prompts. |
src/vs/platform/agentHost/common/sshRemoteAgentHost.ts |
Extends SSH configuration and IPC contracts. |
src/vs/platform/agentHost/common/sshConfigParsing.ts |
Parses effective proxy configuration. |
Review details
Suppressed comments (1)
src/vs/platform/agentHost/node/sshRemoteAgentHostService.ts:1874
- This newly surfaced failure message is also not localized. Use a localized template with placeholders for
proxyKindanddetail, consistent with the other user-facing proxy errors in this method.
socket.destroy(new Error(`${proxyKind} process exited before the SSH connection was established (${detail}).`));
- Files reviewed: 8/8 changed files
- Comments generated: 4
- Review effort level: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
8de3d6f to
beffb0b
Compare
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: Ladislau Szomoru (@lszomoru)Matched files:
|
8de3d6f to
dca870d
Compare
dca870d to
16e5021
Compare
|
@microsoft-github-policy-service agree company="Microsoft" |
16e5021 to
610da08
Compare
610da08 to
0a67175
Compare
|
CI is green except Three runs of this identical tree failed five different tests across three platforms, none of them in code this PR touches. The new path is gated on Locally the — kondv's Copilot 🤖 |
Fixes #317445
Problem
Agent Host resolves effective OpenSSH configuration with
ssh -G, but did not carryProxyJumpinto thessh2connection. A host reachable only through its configured jump host was therefore dialed directly from the Agents window and failed withENOTFOUNDorEHOSTUNREACH, while native OpenSSH and Remote SSH succeeded against the same config.Change
Preserve the resolved
ProxyJumpvalue through initial and reconnect configuration. For a single jump host, start native OpenSSH withBatchMode=yesand-W, pass its standard streams tossh2throughConnectConfig.sock, and stop the owned helper when the SSH connection closes. The destination is passed after--so a config-derived value can never be read as ansshoption.The jump alias, not a pre-resolved hostname, is handed to OpenSSH, so the jump host's own
HostName,User,PortandIdentityFilestill apply. Final-host authentication, host-key verification, Agent Host bootstrap and WebSocket handling are untouched.Single-hop only. Comma-separated chains,
ProxyCommand, interactive jump-host authentication, askpass IPC andHostKeyAliasbehavior are unchanged, and there are no dependency, build or pipeline changes.Validation
npm run compile-client,typecheck-client,valid-layers-check, fulleslint, and hygiene on the changed files — all cleanvs/platform/agentHost/test/{common,node}suite — 5245 passing. Unpatchedmaincontrol runs the same suite at 5237 passing with the same two pre-existingCopilotAgentfailures, so those are unrelated to this change.dca870d(base7b763e653ee2), using disposable profiles, real key-authenticated jump and target SSH servers, and the actual Agent Host WebSocket relay:proxyjump-target.invalid:2222through the configured jump host.mainused the same Agents UI action, dialed the target directly, failed withgetaddrinfo ENOTFOUND, and never contacted the jump or target servers.--terminator was added after that run, so this revision is not byte-identical to the Electron-tested one and the Electron harness was not re-run. It is covered separately: against OpenSSH 9.5p2,ssh -o BatchMode=yes -W target.invalid:22 -Vprints the version and exits 0, while the same command with-- -Vtreats it as a hostname and exits 255; ordinaryhostanduser@hostdestinations are unaffected. A unit regression asserts--is always immediately before the destination, and it fails without the production change.