{"record":{"id":"5ce497accf86f95a","repo":"zed-industries/zed","slug":"no-completion-returned-from-codestral","errorCode":null,"errorMessage":"No completion returned from Codestral","messagePattern":"No completion returned from Codestral","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codestral/src/codestral.rs","lineNumber":192,"sourceCode":"        let codestral_response: CodestralResponse = serde_json::from_str(&body)?;\n\n        let elapsed = start_time.elapsed();\n\n        if let Some(choice) = codestral_response.choices.first() {\n            let completion = &choice.message.content;\n\n            log::debug!(\n                \"Codestral: Completion received ({} tokens, {:.2}s)\",\n                codestral_response.usage.completion_tokens,\n                elapsed.as_secs_f64()\n            );\n\n            // Return just the completion text for insertion at cursor\n            Ok(completion.clone())\n        } else {\n            log::error!(\"Codestral: No completion returned in response\");\n            Err(anyhow::anyhow!(\"No completion returned from Codestral\"))\n        }\n    }\n}\n\nimpl EditPredictionDelegate for CodestralEditPredictionDelegate {\n    fn name() -> &'static str {\n        \"codestral\"\n    }\n\n    fn display_name() -> &'static str {\n        \"Codestral\"\n    }\n\n    fn show_predictions_in_menu() -> bool {\n        true\n    }\n\n    fn icons(&self, _cx: &App) -> EditPredictionIconSet {\n        EditPredictionIconSet::new(IconName::AiMistral)","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/zed-industries/zed/blob/5a9b9558db01a6b906cec2fb70a797affdc58cdd/crates/codestral/src/codestral.rs#L174-L210","documentation":"Returned by fetch_completion when the Codestral API responded successfully but the parsed response contained no choices. The API accepted the request yet produced an empty completion list, so there is no text to insert at the cursor.","triggerScenarios":"Thrown at crates/codestral/src/codestral.rs:192 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Treat as an empty completion and skip inserting any edit prediction","Retry the request; occasional empty responses can be transient","If persistent, verify the prompt/format sent to the FIM endpoint is valid"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5a9b9558db01a6b906cec2fb70a797affdc58cdd","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}