Skip to content

[BUG] SSH-registered github.com marketplace: in-repo plugin pre-flight goes over HTTPS only, so a private marketplace cannot install without a token #3164

Open

Description

@ahegyes

Describe the bug

For a marketplace on github.com registered over SSH (ssh://git@github.com/<org>/<repo>.git or
git@github.com:<org>/<repo>.git), apm install <plugin>@<marketplace> for an in-marketplace subdirectory plugin
validates (and tries to fetch) the plugin over HTTPS — raw.githubusercontent.com, the Contents API on
api.github.com, then an anonymous git ls-remote https://github.com/<org>/<repo>.git — and never over SSH. With no
GitHub token available (SSH-key-only environment: no GITHUB_TOKEN/GH_TOKEN, no gh on PATH, no credential helper),
a private marketplace therefore cannot install any of its in-repo plugins, although apm marketplace add over SSH
succeeds. --ssh and --allow-protocol-fallback do not change this.

This looks like the github.com counterpart of #2063, which fixed the same scheme loss for non-GitHub hosts (there the
resolved dependency is now git: git@host:org/repo.git + path: and validates over SSH — confirmed on 0.33.0).

The fetch itself does honour SSH: when the API allowance is spent, apm logs "GitHub API rate limit hit ... skipping the
pre-flight accessibility probe and letting the download step confirm the package", and the same install then succeeds
over SSH. So only the pre-flight is wrong.

To Reproduce

  1. A private github.com repo org/private-mkt with .claude-plugin/marketplace.json listing
    {"name": "alpha", "source": "./plugins/alpha"}, and SSH access to it.
  2. With no GitHub token reachable by apm:
    apm marketplace add --name mkt ssh://git@github.com/org/private-mkt.git -r <sha>   # succeeds over SSH
    apm install -g -t claude alpha@mkt
  3. Output: org/private-mkt/plugins/alpha#<sha> -- all probes failed (marker-file, Contents API, git ls-remote, shallow-fetch) -- verify the path and ref exist and that your credentials have read access; exit 1.

The same steps against a non-GitHub SSH host install fine.

Expected behavior

The pre-flight for an SSH-registered github.com marketplace's in-repo plugins probes over SSH (as validation does for
non-GitHub hosts since #2063), or is left to the download step, which already uses SSH.

Analysis (0.33.0)

  • resolve_marketplace_plugin builds the right reference — DependencyReference(repo_url='org/private-mkt', host='github.com', explicit_scheme='ssh', ssh_user='git', virtual_path='plugins/alpha', is_virtual=True) — but its
    canonical string is the shorthand org/private-mkt/plugins/alpha#<sha>, which carries no scheme.
  • _validate_package_exists (install/validation.py) sends every virtual package on a GitHub host to
    _validate_virtual_package, i.e. GitHubPackageDownloader probes (raw + Contents API + anonymous HTTPS
    ls-remote). explicit_scheme='ssh' is not consulted; only non-GitHub hosts take _validate_ado_git_package, which
    honours the SSH preference. The marketplace path also constructs that downloader without the CLI's protocol
    preference, so --ssh has no effect there.
  • Related, for non-GitHub SSH hosts on 0.33.0: the blobless partial-clone cache (git/db_v1/<key>__p) is cloned
    from https://<host>/<org>/<repo> first; only after that fails does apm do the SSH shallow fetch. So every first
    fetch of an SSH dependency makes one HTTPS attempt against the host.

Environment

  • OS: macOS 27 (arm64)
  • APM: 0.33.0 (Homebrew formula)
  • Python: 3.14.8

Activity

  1. danielmeppiel commented on Oct 7, 2026

    @danielmeppiel
    Collaborator

    Decision: approve
    Area: project
    Scope: Make preflight validation for in-repository plugins from explicitly SSH-registered github.com marketplaces honor the existing transport selection and remain consistent with the supported download path.
    Done when: An SSH-key-only private GitHub marketplace installs an in-repository plugin without requiring an HTTPS token; explicit transport intent survives marketplace resolution and validation, with no silent HTTPS probe in strict SSH mode; inaccessible repositories, missing refs/paths and authentication failures still fail clearly; existing HTTPS behavior, host-scoped credential isolation, containment and integrity remain intact; and regression plus CLI-level evidence and authentication guidance cover this bounded route.
    Out of scope: Credential-provider redesign; automatic transport-fallback expansion; bypassing validation or integrity checks; the separately reported non-GitHub partial-clone-cache HTTPS attempt; implementation dispatch from this decision session; restarting blocked delivery; PR review or merge approval; release commitments.
    Review contact: Daniel Meppiel (@danielmeppiel)
    Reason: Recorded by Copilot after Daniel Meppiel (@danielmeppiel) explicitly accepted the bounded GitHub SSH-marketplace proposal. This is a human-confirmed product-scope decision, not an automated triage recommendation or authorization to start an automation delivery run. The separate non-GitHub cache observation remains unapproved.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    status/acceptedHuman scope approval; verify the issue's approval record and review contact before work.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions