{"record":{"id":"5136e55d5b04fd09","repo":"zed-industries/zed","slug":"feedback-api-returned-status","errorCode":null,"errorMessage":"Feedback API returned status: {}","messagePattern":"Feedback API returned status: (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/edit_prediction/src/mercury.rs","lineNumber":474,"sourceCode":"    let request_id = prediction_id.0;\n    let app_version = AppVersion::global(cx);\n    cx.background_spawn(async move {\n        let body = FeedbackRequest {\n            request_id,\n            provider_name: \"zed\",\n            user_action: action,\n            provider_version: app_version.to_string(),\n        };\n\n        let request = http_client::Request::builder()\n            .uri(FEEDBACK_API_URL)\n            .method(Method::POST)\n            .header(\"Content-Type\", \"application/json\")\n            .body(AsyncBody::from(serde_json::to_vec(&body)?))?;\n\n        let response = http_client.send(request).await?;\n        if !response.status().is_success() {\n            anyhow::bail!(\"Feedback API returned status: {}\", response.status());\n        }\n\n        log::debug!(\n            \"Mercury feedback sent: request_id={}, action={:?}\",\n            body.request_id,\n            body.user_action\n        );\n\n        anyhow::Ok(())\n    })\n    .detach_and_log_err(cx);\n}\n","sourceCodeStart":456,"sourceCodeEnd":487,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/edit_prediction/src/mercury.rs#L456-L487","documentation":"Telemetry for accept/reject feedback on predictions: after POSTing the user action to the feedback API, a non-success status bails with the status code (mercury.rs:474). The whole task is spawned detached with `detach_and_log_err`, so the error only ever appears in logs and never affects editing or predictions.","triggerScenarios":"The feedback POST returning 4xx/5xx — bad/expired token, endpoint temporarily down, or a proxy blocking the POST — fired in the background right after a prediction is accepted or rejected.","commonSituations":"Transient backend errors during incidents; tokens expiring mid-session; restrictive networks. Users normally never see this; it surfaces when inspecting logs.","solutions":["No user action required for normal editing; feedback loss is harmless.","If it persists in logs, verify sign-in state and network access to the feedback endpoint.","Ignore isolated occurrences during known Zed service incidents."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"Keep the fire-and-forget shape: `spawn(...).detach_and_log_err(cx)` — catch, log at debug/warn with the status, and drop; never surface feedback failures to the editing UI.","preventionTips":["Treat telemetry as strictly optional: never block or notify on its failure.","Rate-limit feedback posts so transient errors do not spam logs.","Batch feedback if the endpoint supports it to reduce failure surface."],"tags":["mercury","telemetry","http","zed","feedback"],"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"}