{"record":{"id":"e60c9914f5ef46f2","repo":"zed-industries/zed","slug":"batch-completed-but-has-no-output-file","errorCode":null,"errorMessage":"Batch {} completed but has no output file","messagePattern":"Batch (.+?) completed but has no output file","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/edit_prediction_cli/src/openai_client.rs","lineNumber":252,"sourceCode":"                &self.api_key,\n                batch_id,\n            )\n            .await\n            .map_err(|e| anyhow::anyhow!(\"Failed to retrieve batch {}: {:?}\", batch_id, e))?;\n\n            log::info!(\"Batch {} status: {}\", batch_id, batch_status.status);\n\n            if batch_status.status != \"completed\" {\n                log::warn!(\n                    \"Batch {} is not completed (status: {}), skipping\",\n                    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;","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/edit_prediction_cli/src/openai_client.rs#L234-L270","documentation":"import_batches confirmed a batch reached 'completed' status, but its record has no output_file_id; without the output file reference the results cannot be downloaded, which indicates an inconsistent batch record on OpenAI's side.","triggerScenarios":"Thrown at crates/edit_prediction_cli/src/openai_client.rs:252 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-check the batch via the OpenAI dashboard","Re-submit the batch if its result file never materializes"],"exampleFix":null,"handlingStrategy":"validation","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-14T05:17:10.506Z"}