zed-industries/zed · error · anyhow::Error

Copilot Chat does not support custom tool calls

Error message

Copilot Chat does not support custom tool calls

What it means

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.

Solutions

  1. Remove custom tools/tool-use content from requests routed to Copilot Chat
  2. Use a provider that supports tool calling for agentic workflows
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/copilot_chat/src/model.rs:902 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/8d8e2b173363b337. Report an issue: GitHub.

Appendix: source

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

                for content in &message.content {
                    match content {
                        MessageContent::Text(text) | MessageContent::Thinking { text, .. }
                            if !text.is_empty() =>
                        {
                            if let Some(ChatMessagePart::Text { text: text_content }) =
                                content_parts.last_mut()
                            {
                                text_content.push_str(text);
                            } else {
                                content_parts.push(ChatMessagePart::Text {
                                    text: text.to_string(),
                                });
                            }
                        }
                        MessageContent::Image(image) if model.supports_vision() => {
                            content_parts.push(ChatMessagePart::Image {
                                image_url: ImageUrl {
                                    url: image.to_base64_url(),
                                },
                            });
                        }
                        _ => {}
                    }
                }

                if !content_parts.is_empty() {
                    messages.push(ChatMessage::User {
                        content: content_parts.into(),
                    });
                }
            }
            Role::Assistant => {
                let mut tool_calls = Vec::new();
                for content in &message.content {
                    if let MessageContent::ToolUse(tool_use) = content {
                        let input = tool_use.input.as_json().ok_or_else(|| {

View on GitHub (pinned to 916fc2b8cb)