zed-industries/zed · error
Failed to download batch results for {}: {:?}
Error message
Failed to download batch results for {}: {:?} What it means
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.
Source
Thrown at crates/edit_prediction_cli/src/openai_client.rs:263
batch_id,
batch_status.status
);
continue;
}
let output_file_id = batch_status.output_file_id.ok_or_else(|| {
anyhow::anyhow!("Batch {} completed but has no output file", batch_id)
})?;
let results_content = batches::download_file(
self.http_client.as_ref(),
OPEN_AI_API_URL,
&self.api_key,
&output_file_id,
)
.await
.map_err(|e| {
anyhow::anyhow!("Failed to download batch results for {}: {:?}", batch_id, e)
})?;
let results = batches::parse_batch_output(&results_content)
.map_err(|e| anyhow::anyhow!("Failed to parse batch output: {:?}", e))?;
let mut updates: Vec<(String, String, String)> = Vec::new();
let mut success_count = 0;
let mut error_count = 0;
for result in results {
let request_hash = result
.custom_id
.strip_prefix("req_hash_")
.unwrap_or(&result.custom_id)
.to_string();
if let Some(response_body) = result.response {
if response_body.status_code == 200 {View on GitHub (pinned to f4178619ac)
Solutions
- Retry the download; transient file-service failures occur
- Check the wrapped error for auth or expiry causes
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at crates/edit_prediction_cli/src/openai_client.rs:263 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20).
Data as JSON: /api/errors/3aac6687c1243600.
Report an issue: GitHub.