Agent plugin marketplace mangles SSH `source.url` when user is not `git` (breaks GHE / self-hosted)

Open
#318,982 1 comment 1 reaction 1 assignee View on GitHub

@connor4312 is already working on this.

Since May 29, 2026.

Assessment

This issue has not been assessed yet.

Description

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.122.0 (Stable)
  • OS Version: macOS 15 (Darwin arm64)
  • Feature: Agent Plugins (Preview), chat.plugins.marketplaces
Summary

If a marketplace plugin's source.url is an SSH URL with a user other than git, VS Code rewrites it to https:/HOST/PATH (single slash) and looks for it as a subdirectory of the marketplace clone. The plugin never installs.

The Copilot CLI clones the same marketplace.json fine using ssh:// or git+ssh://.

Repro

GHE instance whose SSH user is not git:

$ ssh git@acme.ghe.com
Permission denied (publickey).
$ ssh acme@acme.ghe.com
Hi user! You've successfully authenticated...

.github/plugin/marketplace.json:

{
  "name": "agent-plugins",
  "owner": { "name": "Example Org" },
  "plugins": [
    {
      "name": "example-plugin",
      "source": {
        "source": "url",
        "url": "acme@acme.ghe.com:team/example-plugin.git"
      }
    }
  ]
}

settings.json:

"chat.plugins.marketplaces": [
  "acme@acme.ghe.com:org/agent-plugins.git"
]

Marketplace clones, plugin lists, then Install fails with:

Plugin source directory 'https:/acme.ghe.com/team/example-plugin.git'
not found in repository 'acme@acme.ghe.com:org/agent-plugins.git'.
Expected

VS Code clones the SSH URL as written, same as the CLI.

What works in CLI vs VS Code
source.url form CLI VS Code
acme@host:team/plugin.git (SCP) ❌ "Invalid url" ❌ mangled
ssh://acme@host/team/plugin.git ❌ mangled
git+ssh://acme@host/team/plugin.git ❌ mangled
https://host/team/plugin.git ✅ (requires HTTPS creds)
git@host:team/plugin.git n/a n/a (auth fails: git user invalid)

Clearing ~/Library/Application Support/Code/agentPlugins/ and toggling the URL format on re-add doesn't change the result.

Why this hits GHE specifically

The published marketplace schema only lists https:// and git@host:path. VS Code seems to enforce that with ^(https?://|git@), and when the URL doesn't match, it falls back to treating the string as a relative path inside the marketplace clone (note the wording "source directory ... not found in repository ...", which matches the RelativePath path; cf. #311725, #308504).

On a GHE where the SSH user is not git:

  • git@host:path authenticates as the wrong user.
  • Every other valid SSH URL (user@host:path, ssh://, git+ssh://) is mangled before git ever sees it.

The single slash in https:/HOST/PATH looks like a path.normalize() somewhere collapsing //.

Fix
  1. Accept the following as url sources and pass them to git clone verbatim:
    • <user>@<host>:<path> (SCP, any user)
    • ssh://<user>@<host>/<path>
    • git+ssh://<user>@<host>/<path>
  2. Don't silently fall back to RelativePath when the URL doesn't match. Either reject with an explicit "unsupported URL scheme" or accept it.
  3. Reword the error so a misclassified URL doesn't read as a missing subdirectory.
Related
  • #311725 — chat: fix installed url-source plugins after restart (RelativePath vs URL classification)
  • #308504 — URL-source plugins silently uninstall on restart
  • #313029 — .git suffix requirement; non-spec URLs silently mishandled
  • #301111 — Azure DevOps URL rejection (same family)

Drafted with GitHub Copilot CLI (Claude Opus 4.7).

Dominant language
TypeScript
Stars
193k
Forks
42.9k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/vscode

All issues in microsoft/vscode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.