{"record":{"id":"8d8e2b173363b337","repo":"zed-industries/zed","slug":"copilot-chat-does-not-support-custom-tool-calls","errorCode":null,"errorMessage":"Copilot Chat does not support custom tool calls","messagePattern":"Copilot Chat does not support custom tool calls","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/copilot_chat/src/model.rs","lineNumber":921,"sourceCode":"                for content in &message.content {\n                    match content {\n                        MessageContent::Text(text) | MessageContent::Thinking { text, .. }\n                            if !text.is_empty() =>\n                        {\n                            if let Some(ChatMessagePart::Text { text: text_content }) =\n                                content_parts.last_mut()\n                            {\n                                text_content.push_str(text);\n                            } else {\n                                content_parts.push(ChatMessagePart::Text {\n                                    text: text.to_string(),\n                                });\n                            }\n                        }\n                        MessageContent::Image(image) if model.supports_vision() => {\n                            content_parts.push(ChatMessagePart::Image {\n                                image_url: ImageUrl {\n                                    url: image.to_base64_url(),\n                                },\n                            });\n                        }\n                        _ => {}\n                    }\n                }\n\n                if !content_parts.is_empty() {\n                    messages.push(ChatMessage::User {\n                        content: content_parts.into(),\n                    });\n                }\n            }\n            Role::Assistant => {\n                let mut tool_calls = Vec::new();\n                for content in &message.content {\n                    if let MessageContent::ToolUse(tool_use) = content {\n                        let input = tool_use.input.as_json().ok_or_else(|| {","sourceCodeStart":903,"sourceCodeEnd":939,"githubUrl":"https://github.com/zed-industries/zed/blob/916fc2b8cb3a815cbef4a3b40e13081be72036b6/crates/copilot_chat/src/model.rs#L903-L939","documentation":"While converting Zed chat messages to Copilot Chat format, a tool-use content part was encountered; Copilot Chat's API does not support custom tool calls, so the request is rejected up front with this capability sentinel.","triggerScenarios":"Thrown at crates/copilot_chat/src/model.rs:902 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove custom tools/tool-use content from requests routed to Copilot Chat","Use a provider that supports tool calling for agentic workflows"],"exampleFix":null,"handlingStrategy":"validation","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"}