Skip to content

fix(ssh): resolve the SSH config with ssh -G and forward the session type with SendEnv - #1197

Draft
EhabY wants to merge 1 commit into
mainfrom
fix/vsc-8-ssh-g-remote-command
Draft

EhabY wants to merge 1 commit into
mainfrom
fix/vsc-8-ssh-g-remote-command

Conversation

@EhabY

@EhabY EhabY commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

After writing the generated SSH config, the extension resolved the Coder host's options with a manual parser that ignores Include, Match and negated Host lines, so a RemoteCommand from any of them went undetected. The host is now resolved with ssh -G, using the ssh executable the active Remote-SSH extension is configured with, and falls back to the parser if ssh fails.

Also in this PR:

  • PermitLocalCommand no: the generated block sets it, so a LocalCommand elsewhere in the user's config never runs for workspaces.
  • SendEnv instead of SetEnv: the session type is set in the environment ssh inherits and forwarded with SendEnv. This works on every OpenSSH version, so the ssh -V check is gone.
  • Devin config file: Devin 3.12.32+ passes remote.devinSSH.configFile to ssh, so Coder hosts go into that file there.

Refs VSC-8. The post-write check the issue describes was already removed in #1061. Follow-up: VSC-52 (deny deployment-set SendEnv).

Decision log
  • No blocking check: the Include sits at the top of the user's config and ssh keeps the first value it reads, so the pinned options can't be overridden. I confirmed this with ssh -G.
  • ssh executable: each extension's key comes from its shipped code: remote.SSH.path (Microsoft, Cursor, open-remote-ssh in native mode), remote.devinSSH.path and remote.antigravitySSH.path.
    • Windows batch wrappers fall back to the parser, so we never use a shell.
    • Microsoft's Windows search for ssh is not copied. With Git for Windows installed, a different ssh may evaluate the same config, and the worst case is today's behavior.
  • SendEnv: I checked against a real sshd that it delivers the same value as SetEnv. Every extension spawns ssh with process.env. open-remote-ssh's default ssh2 backend ignored SetEnv and exports SendEnv values in its setup script instead of sending them, so the agent still sees a plain SSH session there, as on main: SendEnv is exported in the setup script instead of sent as SSH env requests (ssh2 backend) jeanp413/open-remote-ssh#415.
  • Devin -F: no release from 2.0.44 to 3.11.238 passes it. 3.12.32+ does, read from windsurfVersion in product.json. Antigravity never passes it.

Generated by Coder Agents on behalf of @EhabY.

@linear-code

linear-code Bot commented Nov 17, 2026

Copy link
Copy Markdown

VSC-8

@EhabY EhabY changed the title fix(ssh): resolve the SSH config with ssh -G and disable LocalCommand fix(ssh): resolve the SSH config with ssh -G and forward the session type with SendEnv Nov 17, 2026
@EhabY
EhabY force-pushed the fix/vsc-8-ssh-g-remote-command branch 2 times, most recently from 56a81a5 to bbb0962 Compare November 17, 2026 14:23
@EhabY
EhabY force-pushed the fix/vsc-8-ssh-g-remote-command branch from bbb0962 to 07b4e92 Compare November 17, 2026 14:37

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant