github/copilot-sdk · error · RuntimeError

Unsupported Copilot runtime platform

Error message

Unsupported Copilot runtime platform: {key[0]}/{key[1]}. Supported platforms: {', '.join(f'{p}/{m}' for p, m in RUNTIME_PLATFORMS)}

What it means

get_runtime_platform maps (system, machine) pairs to Copilot runtime platform identifiers, applying musl-specific aliases for Linux libc variants. If the running platform is not a key in RUNTIME_PLATFORMS, the library cannot pick a runtime build and raises this error listing all supported platform strings.

Solutions

  1. Upgrade python/copilot package to a version that supports your platform in RUNTIME_PLATFORMS.
  2. Run on a supported OS/architecture listed in the error message (e.g. darwin/arm64, linux/x86_64).
  3. If on Linux musl, confirm the libc alias mapping (_MUSL_RUNTIME_PLATFORMS) covers your machine string.
  4. Pin the interpreter to run on a supported host rather than an exotic emulated platform.
Defensive patterns

Strategy: validation

Validate before calling

import platform
from copilot._cli_version import RUNTIME_PLATFORMS
key = (platform.system(), platform.machine())
if key not in RUNTIME_PLATFORMS:
    raise RuntimeError(f"unsupported runtime platform {key}")

Try / catch

try:
    platform_id = get_runtime_platform()
except RuntimeError as e:
    if e.args[0].startswith("Unsupported Copilot runtime platform"):
        fall_back_to_remote_runtime()

Prevention

When it happens

Trigger: Calling get_cached_cli_path, ensure_runtime_wrapper, ensure_runtime_library, get_or_download_cli, or get_release_asset_name on a system/machine combination absent from RUNTIME_PLATFORMS (e.g. freebsd, sunos5, armv7l, or an unusual machine tag from platform.system()/platform.machine()).

Common situations: Running on an unsupported OS or architecture (FreeBSD, 32-bit ARM); running under a modified platform reported by an embedded/emulated interpreter; an older library version lacking a newly released platform key.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of github/copilot-sdk@cd8cf15dc3 (2026-09-09). Data as JSON: /api/errors/91e1cf9eb5b00b2a. Report an issue: GitHub.

Appendix: source

Thrown at python/copilot/_cli_version.py:91

    return f"{base}/v{version}/SHA256SUMS.txt"


def get_runtime_platform() -> str:
    """Return the release asset platform name (e.g. ``linux-x64``) for this host.

    The name matches the ``prebuilds`` folder embedded in the release package.
    Raises RuntimeError if the platform is not supported.
    """
    key = get_platform_key()

    if key[0] == "linux" and _is_musl():
        musl = _MUSL_RUNTIME_PLATFORMS.get(key[1])
        if musl:
            return musl

    runtime_platform = RUNTIME_PLATFORMS.get(key)
    if runtime_platform is None:
        raise RuntimeError(
            f"Unsupported Copilot runtime platform: {key[0]}/{key[1]}. "
            f"Supported platforms: {', '.join(f'{p}/{m}' for p, m in RUNTIME_PLATFORMS)}"
        )
    return runtime_platform


def get_release_asset_name(version: str, runtime_platform: str | None = None) -> str:
    """Return the unified runtime package asset name for a version and platform."""
    platform_name = runtime_platform or get_runtime_platform()
    return f"github-copilot-{version}-{platform_name}.tgz"


def get_cli_binary_name() -> str:
    """Return the CLI executable name inside the release package."""
    return "copilot.exe" if sys.platform == "win32" else "copilot"

View on GitHub (pinned to cd8cf15dc3)