{"record":{"id":"e876170487b8d784","repo":"zed-industries/zed","slug":"failed-to-fetch-experiments-body","errorCode":null,"errorMessage":"Failed to fetch experiments: {:?}\nBody: {}","messagePattern":"Failed to fetch experiments: (.+?)\nBody: (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/edit_prediction/src/edit_prediction.rs","lineNumber":1167,"sourceCode":"                    let mut response = client\n                        .authenticated_llm_request(&llm_token, organization_id, |token| {\n                            Ok(http_client::Request::builder()\n                                .method(Method::GET)\n                                .uri(url.as_ref())\n                                .header(\"Authorization\", format!(\"Bearer {token}\"))\n                                .header(ZED_VERSION_HEADER_NAME, app_version.to_string())\n                                .body(Default::default())?)\n                        })\n                        .await?;\n                    if response.status().is_success() {\n                        let mut body = Vec::new();\n                        response.body_mut().read_to_end(&mut body).await?;\n                        let experiments: Vec<String> = serde_json::from_slice(&body)?;\n                        Ok(experiments)\n                    } else {\n                        let mut body = String::new();\n                        response.body_mut().read_to_string(&mut body).await?;\n                        anyhow::bail!(\n                            \"Failed to fetch experiments: {:?}\\nBody: {}\",\n                            response.status(),\n                            body\n                        );\n                    }\n                })\n                .await?;\n            this.update(cx, |this, cx| {\n                this.available_experiments = experiments;\n                cx.notify();\n            })?;\n            anyhow::Ok(())\n        })\n        .detach_and_log_err(cx);\n    }\n\n    pub fn icons(&self, cx: &App) -> edit_prediction_types::EditPredictionIconSet {\n        use ui::IconName;","sourceCodeStart":1149,"sourceCodeEnd":1185,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/edit_prediction/src/edit_prediction.rs#L1149-L1185","documentation":"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.","triggerScenarios":"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.","commonSituations":"Zed backend incidents; corporate proxies filtering api.zed.dev; offline development — in all cases edit-prediction experiments remain disabled until a later successful fetch.","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."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"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.","preventionTips":["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."],"tags":["zed","network","experiments","http","edit-prediction"],"backgroundTag":"http-error-response","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}