{"record":{"id":"3aac6687c1243600","repo":"zed-industries/zed","slug":"failed-to-download-batch-results-for","errorCode":null,"errorMessage":"Failed to download batch results for {}: {:?}","messagePattern":"Failed to download batch results for (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/edit_prediction_cli/src/openai_client.rs","lineNumber":263,"sourceCode":"                    batch_id,\n                    batch_status.status\n                );\n                continue;\n            }\n\n            let output_file_id = batch_status.output_file_id.ok_or_else(|| {\n                anyhow::anyhow!(\"Batch {} completed but has no output file\", batch_id)\n            })?;\n\n            let results_content = batches::download_file(\n                self.http_client.as_ref(),\n                OPEN_AI_API_URL,\n                &self.api_key,\n                &output_file_id,\n            )\n            .await\n            .map_err(|e| {\n                anyhow::anyhow!(\"Failed to download batch results for {}: {:?}\", batch_id, e)\n            })?;\n\n            let results = batches::parse_batch_output(&results_content)\n                .map_err(|e| anyhow::anyhow!(\"Failed to parse batch output: {:?}\", e))?;\n\n            let mut updates: Vec<(String, String, String)> = Vec::new();\n            let mut success_count = 0;\n            let mut error_count = 0;\n\n            for result in results {\n                let request_hash = result\n                    .custom_id\n                    .strip_prefix(\"req_hash_\")\n                    .unwrap_or(&result.custom_id)\n                    .to_string();\n\n                if let Some(response_body) = result.response {\n                    if response_body.status_code == 200 {","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/edit_prediction_cli/src/openai_client.rs#L245-L281","documentation":"import_batches downloads the output file for a completed OpenAI batch; this error wraps a failed download call and names the batch. The results content could not be fetched even though the file ID was known.","triggerScenarios":"Thrown at crates/edit_prediction_cli/src/openai_client.rs:263 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the download; transient file-service failures occur","Check the wrapped error for auth or expiry causes"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}