{"record":{"id":"2c32d48e5165b2b2","repo":"zed-industries/zed","slug":"missing-env-var-zed-server-url","errorCode":null,"errorMessage":"Missing env var `ZED_SERVER_URL`","messagePattern":"Missing env var `ZED_SERVER_URL`","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"script/randomized-test-ci","lineNumber":13,"sourceCode":"#!/usr/bin/env node --redirect-warnings=/dev/null\n\nconst fs = require(\"fs\");\nconst { randomBytes } = require(\"crypto\");\nconst { execFileSync } = require(\"child_process\");\nconst {\n  minimizeTestPlan,\n  buildTests,\n  runTests,\n} = require(\"./randomized-test-minimize\");\n\nconst { ZED_SERVER_URL } = process.env;\nif (!ZED_SERVER_URL) throw new Error(\"Missing env var `ZED_SERVER_URL`\");\n\nmain();\n\nasync function main() {\n  buildTests();\n\n  const seed = randomU64();\n  const commit = execFileSync(\"git\", [\"rev-parse\", \"HEAD\"], {\n    encoding: \"utf8\",\n  }).trim();\n\n  console.log(\"commit:\", commit);\n  console.log(\"starting seed:\", seed);\n\n  const planPath = \"target/test-plan.json\";\n  const minPlanPath = \"target/test-plan.min.json\";\n  const failingSeed = runTests({\n    SEED: seed,","sourceCodeStart":1,"sourceCodeEnd":31,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/script/randomized-test-ci#L1-L31","documentation":"Bailed by copilot_lsp_native_binary_path (copilot.rs:1397) when env::consts::OS is not one of linux, macos, windows — the only platforms for which GitHub publishes a copilot-language-server-* npm package. The function maps OS names to GitHub's platform identifiers (linux/linux, macos/darwin, windows/win32) and has no fallback, so any other target (freebsd, android, ios, ...) aborts server acquisition immediately; this error then propagates through get_copilot_lsp into CopilotServer::Error.","triggerScenarios":"Compiling or running the Zed copilot crate on an OS outside the supported trio — e.g. FreeBSD/OpenBSD builds, Android targets, or any custom std target. The check is compile-target-constant, so the error is deterministic per build, never intermittent.","commonSituations":"Community builds of Zed for FreeBSD; cross-compiling experiments to unusual targets; CI matrix jobs building the copilot crate for a tier-3 platform; embedding the crate in another application that targets a non-desktop OS.","solutions":["Accept that Copilot is unsupported on this OS — there is no npm package to install; disable the feature (turn edit predictions off) instead of retrying.","Run on a supported OS (Linux, macOS, Windows); for BSDs, use the Linux binary via a Linux jail/compat layer (e.g. FreeBSD Linuxulator) so env::consts::OS reports linux.","If vendoring a self-built language server, patch copilot_lsp_native_binary_path to map your platform to an existing package and provide the binary at the expected path.","Gate the call site so the error is surfaced as a clear 'unsupported platform' message rather than a generic Copilot failure."],"exampleFix":"// before\nlet binary_path = copilot_lsp_native_binary_path()?;\n\n// after: fail with actionable context before any network work\nlet binary_path = copilot_lsp_native_binary_path()\n    .context(\"GitHub Copilot only publishes language servers for linux, macos and windows\")?;\n\n// or feature-gate the whole flow at build time\n#[cfg(any(target_os = \"linux\", target_os = \"macos\", target_os = \"windows\"))]\nfn maybe_start_copilot() { /* ... */ }","handlingStrategy":"validation","validationCode":"// Check before any Copilot work; this is a compile-target constant, so it\n// can also be evaluated once at startup.\nfn copilot_platform_supported() -> bool {\n    matches!(env::consts::OS, \"linux\" | \"macos\" | \"windows\")\n}","typeGuard":"fn copilot_platform() -> Option<&'static str> {\n    match env::consts::OS {\n        \"linux\" => Some(\"linux\"),\n        \"macos\" => Some(\"darwin\"),\n        \"windows\" => Some(\"win32\"),\n        _ => None,\n    }\n}","tryCatchPattern":"// Not really catchable at runtime — fail fast at startup with a clear message.\nlet Some(_platform) = copilot_platform() else {\n    anyhow::bail!(\"Copilot is unsupported on {}\", env::consts::OS);\n};","preventionTips":["Gate Copilot features with #[cfg(any(target_os = \"linux\", target_os = \"macos\", target_os = \"windows\"))].","Show a 'not supported on this OS' notice instead of letting the generic start error surface.","For BSD systems, run under a Linux compat layer so the target reports linux.","Document supported platforms wherever you expose Copilot toggles."],"tags":["copilot","zed","platform-support","cross-compilation"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}