zed-industries/zed · error

unsupported Copilot language server platform

Error message

unsupported Copilot language server platform: {platform}

What it means

copilot_lsp_native_binary_path() maps the current OS to the npm package platform tag — linux, darwin (macOS), win32 (windows) — and any other env::consts::OS value falls into the catch-all arm and bails with the platform name. GitHub publishes @github/copilot-language-server binaries only for those three platforms, so on any other target (freebsd, android, haiku, ...) the path cannot even be computed. The sibling architecture check bails separately for non-x64/arm64 CPUs.

Solutions

  1. Disable the copilot feature when building for unsupported platforms (feature flag / cfg gate) so the code path never runs
  2. If you maintain a port, map your platform to a compatible published package (e.g. freebsd -> linux binary via linuxulator only works if you also patch this match and the binary is truly compatible)
  3. Use GitHub Copilot via an alternative integration (e.g. a language-server proxy on a supported host) instead of the native binary path
  4. For forks: extend the match with your platform string and provide the package/binary naming it expects

Example fix

// Cargo.toml / build config — before
default = ["copilot"]

// after (gate the feature on supported targets)
[target.'cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))'.dependencies]
copilot = { path = "../copilot" }
Defensive patterns

Strategy: validation

Validate before calling

// gate at build/runtime before Copilot startup is attempted
const COPILOT_PLATFORM_SUPPORTED: bool =
    cfg!(any(target_os = "linux", target_os = "macos", target_os = "windows"))
    && cfg!(any(target_arch = "x86_64", target_arch = "aarch64"));

if !COPILOT_PLATFORM_SUPPORTED {
    disable_copilot_feature(); // never call start_copilot on this target
}

Type guard

fn copilot_platform_supported() -> bool {
    matches!(std::env::consts::OS, "linux" | "macos" | "windows")
        && matches!(std::env::consts::ARCH, "x86_64" | "aarch64")
}

Try / catch

match start_copilot(...).await {
    Err(err) if err.to_string().contains("unsupported Copilot language server platform") => {
        // platform mismatch is permanent — disable the feature, do not retry
        disable_copilot_feature();
    }
    other => other,
}

Prevention

When it happens

Trigger: Running Zed (or code linking the copilot crate) on an OS where env::consts::OS is not "linux", "macos", or "windows" — e.g. FreeBSD build, Android termux, or a niche target — and the Copilot start path calls copilot_lsp_native_binary_path().

Common situations: Community builds of Zed for FreeBSD; running under Android/Termux; feature-gating missed so the copilot crate initializes on an unsupported platform; downstream forks porting to new OSes without patching this mapping.

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 zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/49b1b8acfe70468b. Report an issue: GitHub.

Appendix: source

Thrown at crates/copilot/src/copilot.rs:1397

    if should_install {
        node_runtime
            .npm_install_latest_packages(paths::copilot_dir(), &[PACKAGE_NAME])
            .await?;
    }

    if fs.is_file(&binary_path).await {
        return Ok(binary_path);
    }

    anyhow::bail!("GitHub Copilot native language server binary was not installed")
}

fn copilot_lsp_native_binary_path() -> anyhow::Result<PathBuf> {
    let platform = match env::consts::OS {
        "linux" => "linux",
        "macos" => "darwin",
        "windows" => "win32",
        platform => anyhow::bail!("unsupported Copilot language server platform: {platform}"),
    };
    let architecture = match env::consts::ARCH {
        "aarch64" => "arm64",
        "x86_64" => "x64",
        architecture => {
            anyhow::bail!("unsupported Copilot language server architecture: {architecture}")
        }
    };

    let package_name = format!("copilot-language-server-{platform}-{architecture}");

    let executable_name = if cfg!(target_os = "windows") {
        "copilot-language-server.exe"
    } else {
        "copilot-language-server"
    };
    Ok(paths::copilot_dir()
        .join("node_modules")

View on GitHub (pinned to f4178619ac)