zed-industries/zed · error

Batch {} completed but has no output file

Error message

Batch {} completed but has no output file

What it means

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.

Source

Thrown at crates/edit_prediction_cli/src/openai_client.rs:252

                &self.api_key,
                batch_id,
            )
            .await
            .map_err(|e| anyhow::anyhow!("Failed to retrieve batch {}: {:?}", batch_id, e))?;

            log::info!("Batch {} status: {}", batch_id, batch_status.status);

            if batch_status.status != "completed" {
                log::warn!(
                    "Batch {} is not completed (status: {}), skipping",
                    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;

View on GitHub (pinned to f4178619ac)

Solutions

  1. Re-check the batch via the OpenAI dashboard
  2. Re-submit the batch if its result file never materializes
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/edit_prediction_cli/src/openai_client.rs:252 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/e60c9914f5ef46f2. Report an issue: GitHub.