{"record":{"id":"3fe784406888fd54","repo":"zed-industries/zed","slug":"unexpected-response-structure-json-stringify-da","errorCode":null,"errorMessage":"Unexpected response structure: ${JSON.stringify(data)}","messagePattern":"Unexpected response structure: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"script/get-release-notes-since","lineNumber":100,"sourceCode":"      },\n      body: JSON.stringify({\n        query,\n        variables: { owner: \"zed-industries\", repo: \"zed\", cursor },\n      }),\n    });\n\n    if (!response.ok) {\n      throw new Error(`HTTP error! status: ${response.status}`);\n    }\n\n    const data = await response.json();\n\n    if (data.errors) {\n      throw new Error(`GraphQL error: ${JSON.stringify(data.errors)}`);\n    }\n\n    if (!data.data || !data.data.repository || !data.data.repository.releases) {\n      throw new Error(`Unexpected response structure: ${JSON.stringify(data)}`);\n    }\n\n    const releases = data.data.repository.releases.nodes;\n    allReleases = allReleases.concat(releases);\n\n    hasNextPage = data.data.repository.releases.pageInfo.hasNextPage;\n    cursor = data.data.repository.releases.pageInfo.endCursor;\n\n    lastReleaseOnPage = releases[releases.length - 1];\n\n    if (\n      releases.length > 0 &&\n      new Date(lastReleaseOnPage.createdAt) < startDate\n    ) {\n      break;\n    }\n  }\n","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/script/get-release-notes-since#L82-L118","documentation":"Bailed by get_copilot_lsp (copilot.rs:1389) after the whole acquisition sequence succeeded or was skipped: it queried the latest @github/copilot-language-server version from npm, computed binary_path via copilot_lsp_native_binary_path(), optionally ran npm_install_latest_packages, and then fs.is_file(&binary_path) is still false. It means the install pipeline reported success (or decided no install was needed) yet the platform-specific executable at <copilot_dir>/node_modules/@github/copilot-language-server-<platform>-<arch>/<exe> is absent. This becomes the {error} stored in CopilotServer::Error, later resurfaced by as_running.","triggerScenarios":"npm install completing without error but the package layout not containing the expected native binary path (version layout change); should_install evaluating false because should_install_npm_package saw the language-server.js marker file, while the native binary specifically is missing; fs.is_file failing due to permissions; antivirus quarantining the executable on Windows; partially written copilot dir.","commonSituations":"Upgrading from an older Zed whose installed package version predates the native-binary layout (marker file present, binary absent); Windows Defender/antivirus removing copilot-language-server.exe; corrupted or half-deleted paths::copilot_dir() after a crash; disk-full during npm unpack; npm cache serving a truncated package.","solutions":["Run copilot: Reinstall (reinstall() at copilot.rs:841) — it clears the copilot directory and reinstalls from scratch, fixing stale/corrupt layouts.","Manually delete the copilot dir (paths::copilot_dir(), e.g. ~/.local/share/Zed/copilot on Linux, ~/Library/Application Support/Zed/copilot on macOS) and restart Zed.","On Windows, add an antivirus exclusion for the Zed data directory or restore the quarantined copilot-language-server.exe.","Check disk space and write permissions on the data directory.","Verify the expected path exists after install: node_modules/@github/copilot-language-server-<platform>-<arch>/copilot-language-server[.exe]; if the npm package changed its layout, update Zed to a version tracking the new layout."],"exampleFix":"// before: treating a missing binary as fatal\nlet path = get_copilot_lsp(fs, node_runtime).await?;\n\n// after: clear the stale install once, then retry before giving up\nmatch get_copilot_lsp(fs.clone(), node_runtime.clone()).await {\n    Err(err) if err.to_string().contains(\"binary was not installed\") => {\n        clear_copilot_dir().await;\n        get_copilot_lsp(fs, node_runtime).await?\n    }\n    result => result?,\n}","handlingStrategy":"retry","validationCode":"// Pre-flight: verify the expected native binary path exists before starting.\n// (mirror of copilot_lsp_native_binary_path's layout)\nfn installed_binary_present(fs: &Arc<dyn Fs>) -> bool {\n    copilot_lsp_native_binary_path()\n        .map(|p| fs.metadata_sync(&p).is_ok())\n        .unwrap_or(false)\n}","typeGuard":"fn copilot_install_healthy(fs: &Arc<dyn Fs>) -> bool {\n    matches!(copilot_lsp_native_binary_path(), Ok(path) if fs.is_file_sync(&path))\n}","tryCatchPattern":"// Missing-binary is the classic case for clear-then-reinstall, one retry.\nlet attempt = get_copilot_lsp(fs.clone(), node_runtime.clone()).await;\nlet path = match attempt {\n    Ok(path) => path,\n    Err(err) if err.to_string().contains(\"binary was not installed\") => {\n        clear_copilot_dir().await;\n        get_copilot_lsp(fs, node_runtime).await?\n    }\n    Err(err) => return Err(err),\n};","preventionTips":["Add an antivirus exclusion for Zed's data directory on Windows.","Run the copilot: Reinstall action after Zed updates that change the server package layout.","Do not manually delete individual files inside paths::copilot_dir(); clear the whole directory so the marker file and binary stay consistent.","Monitor free disk space on the data volume — truncated npm unpacks produce exactly this error."],"tags":["copilot","zed","npm","installation","filesystem"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}