zed-industries/zed · warning · Error

HTTP error! status: ${response.status}

Error message

HTTP error! status: ${response.status}

What it means

Returned as an immediately-ready Err task by Copilot::sign_in (copilot.rs:814) when self.server is not CopilotServer::Running. The in-code comment states the intent: while the server is Starting (npm download in progress) the caller should wait for the start task, and in a stuck/Error state the UI should show it to the user. So this is a lifecycle-guard error, not a failure of sign-in itself: Disabled, Starting, and Error states all fall into the else branch.

Source

Thrown at script/get-release-notes-since:90

  let allReleases = [];
  let hasNextPage = true;
  let cursor = null;

  while (hasNextPage) {
    const response = await fetch("https://api.github.com/graphql", {
      method: "POST",
      headers: {
        Authorization: `Bearer ${GITHUB_ACCESS_TOKEN}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        query,
        variables: { owner: "zed-industries", repo: "zed", cursor },
      }),
    });

    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }

    const data = await response.json();

    if (data.errors) {
      throw new Error(`GraphQL error: ${JSON.stringify(data.errors)}`);
    }

    if (!data.data || !data.data.repository || !data.data.repository.releases) {
      throw new Error(`Unexpected response structure: ${JSON.stringify(data)}`);
    }

    const releases = data.data.repository.releases.nodes;
    allReleases = allReleases.concat(releases);

    hasNextPage = data.data.repository.releases.pageInfo.hasNextPage;
    cursor = data.data.repository.releases.pageInfo.endCursor;

View on GitHub (pinned to bc538def45)

Solutions

  1. Wait for startup to finish: poll/await the Status returned by copilot.status() until it is no longer Status::Starting (the start task stored in Starting { task } completes and flips the state).
  2. If status is Error(e), address the underlying start error (see 'copilot was not started because of an error') or run copilot: Reinstall, then sign in.
  3. If status is Disabled, enable edit predictions with Copilot in settings ("edit_predictions": { "mode": "subword", "copilot": { ... } } / select Copilot as provider) so the server actually starts.
  4. Only call sign_in when status() is one of SignedOut/Unauthorized/SigningIn/Authorized.

Example fix

// before
let result = copilot.sign_in(cx).await; // fires too early during download

// after: gate on the public status enum
match copilot.status() {
    Status::Starting { task } => { task.await; copilot.sign_in(cx).await }
    Status::Error(e) => Err(anyhow!("copilot not started: {e}")),
    Status::Disabled => Err(anyhow!("copilot is disabled in settings")),
    _ => copilot.sign_in(cx).await,
}
Defensive patterns

Strategy: validation

Validate before calling

// Only sign in against a live server; wait out the Starting phase first.
match copilot.status() {
    Status::Starting { task } => task.await, // download finishes, state flips
    _ => {}
}
if !matches!(copilot.status(), Status::Disabled | Status::Error(_)) {
    copilot.sign_in(cx).await?;
}

Type guard

fn can_sign_in_now(status: &Status) -> bool {
    !matches!(status, Status::Starting { .. } | Status::Error(_) | Status::Disabled)
}

Try / catch

if let Err(err) = copilot.sign_in(cx).await {
    if format!("{err}").contains("hasn't started yet") {
        // lifecycle race: re-check status() and re-dispatch, do not show as fatal
    } else {
        return Err(err);
    }
}

Prevention

When it happens

Trigger: Invoking sign_in before the background start task finished (CopilotServer::Starting, e.g. first-ever launch still downloading the npm package), after the server entered CopilotServer::Error, or while edit predictions are disabled so the server is CopilotServer::Disabled.

Common situations: User clicks 'Sign in to GitHub Copilot' seconds after first install while the language server is still downloading; a UI element calling sign_in on window focus without checking status; Copilot disabled in settings (edit_predictions provider off) but a stale sign-in button still visible; retrying sign-in after a start failure without reinstalling.

Related errors


AI-assisted analysis of zed-industries/zed@bc538def45 (2026-08-16). Data as JSON: /api/errors/0738391d79b85e48. Report an issue: GitHub.