{"record":{"id":"49b1b8acfe70468b","repo":"zed-industries/zed","slug":"unsupported-copilot-language-server-platform-pla","errorCode":null,"errorMessage":"unsupported Copilot language server platform: {platform}","messagePattern":"unsupported Copilot language server platform: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/copilot/src/copilot.rs","lineNumber":1397,"sourceCode":"    if should_install {\n        node_runtime\n            .npm_install_latest_packages(paths::copilot_dir(), &[PACKAGE_NAME])\n            .await?;\n    }\n\n    if fs.is_file(&binary_path).await {\n        return Ok(binary_path);\n    }\n\n    anyhow::bail!(\"GitHub Copilot native language server binary was not installed\")\n}\n\nfn copilot_lsp_native_binary_path() -> anyhow::Result<PathBuf> {\n    let platform = match env::consts::OS {\n        \"linux\" => \"linux\",\n        \"macos\" => \"darwin\",\n        \"windows\" => \"win32\",\n        platform => anyhow::bail!(\"unsupported Copilot language server platform: {platform}\"),\n    };\n    let architecture = match env::consts::ARCH {\n        \"aarch64\" => \"arm64\",\n        \"x86_64\" => \"x64\",\n        architecture => {\n            anyhow::bail!(\"unsupported Copilot language server architecture: {architecture}\")\n        }\n    };\n\n    let package_name = format!(\"copilot-language-server-{platform}-{architecture}\");\n\n    let executable_name = if cfg!(target_os = \"windows\") {\n        \"copilot-language-server.exe\"\n    } else {\n        \"copilot-language-server\"\n    };\n    Ok(paths::copilot_dir()\n        .join(\"node_modules\")","sourceCodeStart":1379,"sourceCodeEnd":1415,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/copilot/src/copilot.rs#L1379-L1415","documentation":"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.","triggerScenarios":"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().","commonSituations":"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.","solutions":["Disable the copilot feature when building for unsupported platforms (feature flag / cfg gate) so the code path never runs","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)","Use GitHub Copilot via an alternative integration (e.g. a language-server proxy on a supported host) instead of the native binary path","For forks: extend the match with your platform string and provide the package/binary naming it expects"],"exampleFix":"// Cargo.toml / build config — before\ndefault = [\"copilot\"]\n\n// after (gate the feature on supported targets)\n[target.'cfg(any(target_os = \"linux\", target_os = \"macos\", target_os = \"windows\"))'.dependencies]\ncopilot = { path = \"../copilot\" }","handlingStrategy":"validation","validationCode":"// gate at build/runtime before Copilot startup is attempted\nconst COPILOT_PLATFORM_SUPPORTED: bool =\n    cfg!(any(target_os = \"linux\", target_os = \"macos\", target_os = \"windows\"))\n    && cfg!(any(target_arch = \"x86_64\", target_arch = \"aarch64\"));\n\nif !COPILOT_PLATFORM_SUPPORTED {\n    disable_copilot_feature(); // never call start_copilot on this target\n}","typeGuard":"fn copilot_platform_supported() -> bool {\n    matches!(std::env::consts::OS, \"linux\" | \"macos\" | \"windows\")\n        && matches!(std::env::consts::ARCH, \"x86_64\" | \"aarch64\")\n}","tryCatchPattern":"match start_copilot(...).await {\n    Err(err) if err.to_string().contains(\"unsupported Copilot language server platform\") => {\n        // platform mismatch is permanent — disable the feature, do not retry\n        disable_copilot_feature();\n    }\n    other => other,\n}","preventionTips":["Feature-gate the copilot crate to linux/macos/windows targets in build config","Check the supported matrix (3 OSes x x64/arm64) before filing install bugs on niche platforms","For unsupported platforms, use a remote/LSI-based Copilot integration instead of the native binary"],"tags":["copilot","platform-support","unsupported-os","installation"],"backgroundTag":"unsupported-platform","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}