zed-industries/zed · error

Failed to retrieve batch results for {}: {:?}

Error message

Failed to retrieve batch results for {}: {:?}

What it means

import_batches finished retrieving a batch whose status is 'ended', then fetching its results file failed; the message names the batch and the wrapped retrieval error. The batch exists but its output could not be downloaded.

Source

Thrown at crates/edit_prediction_cli/src/anthropic_client.rs:346

            if batch_status.processing_status != "ended" {
                log::warn!(
                    "Batch {} is not finished (status: {}), skipping",
                    batch_id,
                    batch_status.processing_status
                );
                continue;
            }

            let results = anthropic::batches::retrieve_batch_results(
                self.http_client.as_ref(),
                ANTHROPIC_API_URL,
                &self.api_key,
                batch_id,
            )
            .await
            .map_err(|e| {
                anyhow::anyhow!("Failed to retrieve batch results for {}: {:?}", batch_id, 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();

                match result.result {
                    anthropic::batches::BatchResult::Succeeded { message } => {
                        let response_json = serde_json::to_string(&message)?;
                        updates.push((request_hash, response_json, batch_id.clone()));
                        success_count += 1;

View on GitHub (pinned to f4178619ac)

Solutions

  1. Retry the results download; expired result files may require re-submitting the batch
  2. Check the wrapped error for auth/network causes
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at crates/edit_prediction_cli/src/anthropic_client.rs:346 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/1e4aaaa1ad7d8ddb. Report an issue: GitHub.