zed-industries/zed · error

Attempted to read an image, but this model doesn't support…

Error message

Attempted to read an image, but this model doesn't support it.

What it means

A tool returned an image in its output but the current model lacks image support, so when building the LLM request the image cannot be included and this error replaces it (with a placeholder text used instead where other content exists).

Solutions

  1. The tool returned an image but the active model cannot consume images; the thread substitutes a text placeholder '[Tool responded with an image, but this model doesn't support images]' for the model while keeping real output for the user
  2. Switch to a vision-capable model if the image content matters to the agent's reasoning
  3. Adjust the tool to emit a text summary alongside or instead of images
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/agent/src/thread.rs:3662 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@916fc2b8cb (2026-08-20). Data as JSON: /api/errors/ef7d64ce5119a27f. Report an issue: GitHub.

Appendix: source

Thrown at crates/agent/src/thread.rs:3696

                Ok(mut output) => {
                    let contains_image = output
                        .llm_output
                        .iter()
                        .any(|part| matches!(part, LanguageModelToolResultContent::Image(_)));
                    if contains_image && !supports_images {
                        // Replace each image part with an inline placeholder so
                        // any accompanying text is still presented to the model.
                        // If there's nothing else in the output, surface an error
                        // to match the pre-multi-part behavior for image-only
                        // tool results.
                        let placeholder = LanguageModelToolResultContent::Text(Arc::from(
                            "[Tool responded with an image, but this model doesn't support images]",
                        ));
                        let has_non_image = output
                            .llm_output
                            .iter()
                            .any(|part| !matches!(part, LanguageModelToolResultContent::Image(_)));
                        if has_non_image {
                            output.llm_output = output
                                .llm_output
                                .into_iter()
                                .map(|part| match part {
                                    LanguageModelToolResultContent::Image(_) => placeholder.clone(),
                                    other => other,
                                })
                                .collect();
                            (false, output)
                        } else {
                            let output = anyhow::anyhow!(
                                "Attempted to read an image, but this model doesn't support it.",
                            )
                            .into();
                            (true, output)
                        }
                    } else {
                        (false, output)

View on GitHub (pinned to 916fc2b8cb)