{"record":{"id":"ef7d64ce5119a27f","repo":"zed-industries/zed","slug":"attempted-to-read-an-image-but-this-model-doesn-t","errorCode":null,"errorMessage":"Attempted to read an image, but this model doesn't support it.","messagePattern":"Attempted to read an image, but this model doesn't support it\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/agent/src/thread.rs","lineNumber":3696,"sourceCode":"                Ok(mut output) => {\n                    let contains_image = output\n                        .llm_output\n                        .iter()\n                        .any(|part| matches!(part, LanguageModelToolResultContent::Image(_)));\n                    if contains_image && !supports_images {\n                        // Replace each image part with an inline placeholder so\n                        // any accompanying text is still presented to the model.\n                        // If there's nothing else in the output, surface an error\n                        // to match the pre-multi-part behavior for image-only\n                        // tool results.\n                        let placeholder = LanguageModelToolResultContent::Text(Arc::from(\n                            \"[Tool responded with an image, but this model doesn't support images]\",\n                        ));\n                        let has_non_image = output\n                            .llm_output\n                            .iter()\n                            .any(|part| !matches!(part, LanguageModelToolResultContent::Image(_)));\n                        if has_non_image {\n                            output.llm_output = output\n                                .llm_output\n                                .into_iter()\n                                .map(|part| match part {\n                                    LanguageModelToolResultContent::Image(_) => placeholder.clone(),\n                                    other => other,\n                                })\n                                .collect();\n                            (false, output)\n                        } else {\n                            let output = anyhow::anyhow!(\n                                \"Attempted to read an image, but this model doesn't support it.\",\n                            )\n                            .into();\n                            (true, output)\n                        }\n                    } else {\n                        (false, output)","sourceCodeStart":3678,"sourceCodeEnd":3714,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/crates/agent/src/thread.rs#L3678-L3714","documentation":"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).","triggerScenarios":"Thrown at crates/agent/src/thread.rs:3662 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["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","Switch to a vision-capable model if the image content matters to the agent's reasoning","Adjust the tool to emit a text summary alongside or instead of images"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"916fc2b8cb3a815cbef4a3b40e13081be72036b6","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}