zed-industries/zed · error

GraphQL endpoint discovery failed: {}

Error message

GraphQL endpoint discovery failed: {}

What it means

The GraphQL query used to discover the Copilot Chat API endpoint failed; the message wraps the discovery error (network failure or GraphQL error response). Zed could not learn which API base URL to use for Copilot Chat requests.

Source

Thrown at crates/copilot_chat/src/copilot_chat.rs:957

    oauth_token: &str,
    configuration: &CopilotChatConfiguration,
    client: &Arc<dyn HttpClient>,
) -> Result<String> {
    let graphql_url = configuration.graphql_url();
    let query = serde_json::json!({
        "query": "query { viewer { copilotEndpoints { api } } }"
    });

    let request = HttpRequest::builder()
        .method(Method::POST)
        .uri(graphql_url.as_str())
        .header("Authorization", format!("Bearer {}", oauth_token))
        .header("Content-Type", "application/json")
        .body(AsyncBody::from(serde_json::to_string(&query)?))?;

    let mut response = client.send(request).await?;

    anyhow::ensure!(
        response.status().is_success(),
        "GraphQL endpoint discovery failed: {}",
        response.status()
    );

    let mut body = Vec::new();
    response.body_mut().read_to_end(&mut body).await?;
    let body_str = std::str::from_utf8(&body)?;

    let parsed: GraphQLResponse = serde_json::from_str(body_str)
        .context("Failed to parse GraphQL response for Copilot endpoint discovery")?;

    let data = parsed
        .data
        .context("GraphQL response contained no data field")?;

    Ok(data.viewer.copilot_endpoints.api)
}

View on GitHub (pinned to f4178619ac)

Solutions

  1. Check network access to the Copilot GraphQL endpoint
  2. Re-authenticate if the token was rejected (see the wrapped error)
  3. Retry; transient failures of discovery are common
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at crates/copilot_chat/src/copilot_chat.rs:957 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/bc32abe2219efc68. Report an issue: GitHub.