{"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":902,"sourceCode":"                                },\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(|| {\n                            anyhow!(\"Copilot Chat does not support custom tool calls\")\n                        })?;\n                        tool_calls.push(ToolCall {\n                            id: tool_use.id.to_string(),\n                            content: ToolCallContent::Function {\n                                function: FunctionContent {\n                                    name: tool_use.name.to_string(),\n                                    arguments: serde_json::to_string(input)?,\n                                    thought_signature: tool_use.thought_signature.clone(),\n                                },\n                            },\n                        });\n                    }\n                }\n\n                let text_content = {\n                    let mut buffer = String::new();\n                    for string in message.content.iter().filter_map(|content| match content {\n                        MessageContent::Text(text) => Some(text.as_str()),","sourceCodeStart":884,"sourceCodeEnd":920,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/copilot_chat/src/model.rs#L884-L920","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":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}