zed-industries/zed · warning
Failed to fetch experiments: {:?} Body: {}
Error message
Failed to fetch experiments: {:?}
Body: {} What it means
Zed edit-prediction periodically GETs its experiments endpoint (sending the Zed version header) to learn which experiments are enabled for this build; a non-2xx response bails with the status and the response body (edit_prediction.rs:1167). On failure `available_experiments` simply stays unset, so the feature degrades rather than crashes.
Source
Thrown at crates/edit_prediction/src/edit_prediction.rs:1167
let mut response = client
.authenticated_llm_request(&llm_token, organization_id, |token| {
Ok(http_client::Request::builder()
.method(Method::GET)
.uri(url.as_ref())
.header("Authorization", format!("Bearer {token}"))
.header(ZED_VERSION_HEADER_NAME, app_version.to_string())
.body(Default::default())?)
})
.await?;
if response.status().is_success() {
let mut body = Vec::new();
response.body_mut().read_to_end(&mut body).await?;
let experiments: Vec<String> = serde_json::from_slice(&body)?;
Ok(experiments)
} else {
let mut body = String::new();
response.body_mut().read_to_string(&mut body).await?;
anyhow::bail!(
"Failed to fetch experiments: {:?}\nBody: {}",
response.status(),
body
);
}
})
.await?;
this.update(cx, |this, cx| {
this.available_experiments = experiments;
cx.notify();
})?;
anyhow::Ok(())
})
.detach_and_log_err(cx);
}
pub fn icons(&self, cx: &App) -> edit_prediction_types::EditPredictionIconSet {
use ui::IconName;View on GitHub (pinned to f4178619ac)
Solutions
- If you rely on the experiments, verify network access to the Zed API host and retry once connectivity returns.
- Otherwise no action is needed — the fetch is non-blocking for the rest of edit prediction and the editor.
- If it persists with 4xx statuses, report it — a version-header mismatch may be involved.
Defensive patterns
Strategy: fallback
Try / catch
Wrap the fetch and treat any Err as "experiments unavailable": keep the previous (empty) experiment set, log at warn, and schedule the next periodic fetch — never propagate into the editing flow.
Prevention
- Treat optional capability fetches as best-effort with their own error boundary.
- Log status + body once per occurrence to catch persistent auth regressions.
- Keep a cached last-known experiments list to survive transient outages.
When it happens
Trigger: The experiments endpoint returning 5xx during an incident, a 4xx from an auth/CDN layer, or the client being unable to pass a proxy that blocks the Zed API host — any non-success status on that GET.
Common situations: Zed backend incidents; corporate proxies filtering api.zed.dev; offline development — in all cases edit-prediction experiments remain disabled until a later successful fetch.
Understand the failure class
Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.
Related errors
- Request failed with status: {status:?} Body: {body}
- Request failed with status: {:?} Body: {}
- failed to fetch '{url}': status code {}
- failed to fetch '{url}': status code {}
- missing Content-Type header
AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20).
Data as JSON: /api/errors/e876170487b8d784.
Report an issue: GitHub.