zed-industries/zed · error · LanguageModelCompletionError

Response contained no delta

Error message

Response contained no delta

What it means

In map_to_language_model_completion_events: a streamed completion event arrived whose choices array was empty (the `let Some(choice) = event.choices.first() else` branch), so there is no delta or message content to convert into a completion event.

Source

Thrown at crates/copilot_chat/src/model.rs:359

            if let Some(event) = state.events.next().await {
                match event {
                    Ok(event) => {
                        let Some(choice) = event.choices.first() else {
                            return Some((
                                vec![Err(anyhow!("Response contained no choices").into())],
                                state,
                            ));
                        };

                        let delta = if is_streaming {
                            choice.delta.as_ref()
                        } else {
                            choice.message.as_ref()
                        };

                        let Some(delta) = delta else {
                            return Some((
                                vec![Err(anyhow!("Response contained no delta").into())],
                                state,
                            ));
                        };

                        let mut events = Vec::new();
                        if let Some(content) = delta.content.clone() {
                            events.push(Ok(LanguageModelCompletionEvent::Text(content)));
                        }

                        // Capture reasoning data from the delta (e.g. for Gemini 3)
                        if let Some(opaque) = delta.reasoning_opaque.clone() {
                            state.reasoning_opaque = Some(opaque);
                        }
                        if let Some(text) = delta.reasoning_text.clone() {
                            state.reasoning_text = Some(text);
                        }

                        for (index, tool_call) in delta.tool_calls.iter().enumerate() {

View on GitHub (pinned to f4178619ac)

Solutions

  1. Retry the completion; a missing delta is usually a transient protocol glitch
  2. Report/update if it reproduces consistently with a given model
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/copilot_chat/src/model.rs:359 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/11f315fee4312c65. Report an issue: GitHub.