{"record":{"id":"1b858c60263a22c6","repo":"zed-industries/zed","slug":"deepseek-does-not-support-custom-tool-calls","errorCode":null,"errorMessage":"DeepSeek does not support custom tool calls","messagePattern":"DeepSeek does not support custom tool calls","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/language_models/src/provider/deepseek.rs","lineNumber":410,"sourceCode":"                                tool_calls: Vec::new(),\n                                reasoning_content: current_reasoning.take(),\n                            },\n                            Role::System => deepseek::RequestMessage::System { content: text },\n                        });\n                    }\n                }\n                MessageContent::Thinking { text, .. } => {\n                    // Accumulate reasoning content for next assistant message\n                    current_reasoning.get_or_insert_default().push_str(&text);\n                }\n                MessageContent::RedactedThinking(_) => {}\n                MessageContent::Image(_) => {}\n                MessageContent::Compaction(_) => {}\n                MessageContent::ToolUse(tool_use) => {\n                    let input = tool_use\n                        .input\n                        .as_json()\n                        .ok_or_else(|| anyhow!(\"DeepSeek does not support custom tool calls\"))?;\n                    let tool_call = deepseek::ToolCall {\n                        id: tool_use.id.to_string(),\n                        content: deepseek::ToolCallContent::Function {\n                            function: deepseek::FunctionContent {\n                                name: tool_use.name.to_string(),\n                                arguments: serde_json::to_string(input).unwrap_or_default(),\n                            },\n                        },\n                    };\n\n                    if let Some(deepseek::RequestMessage::Assistant { tool_calls, .. }) =\n                        messages.last_mut()\n                    {\n                        tool_calls.push(tool_call);\n                    } else {\n                        messages.push(deepseek::RequestMessage::Assistant {\n                            content: None,\n                            tool_calls: vec![tool_call],","sourceCodeStart":392,"sourceCodeEnd":428,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/language_models/src/provider/deepseek.rs#L392-L428","documentation":"Guard in into_deepseek: the request contains a tool with LanguageModelRequestToolInput::Custom, which the DeepSeek wire format has no representation for, so request conversion refuses rather than silently dropping the tool.","triggerScenarios":"Thrown at crates/language_models/src/provider/deepseek.rs:410 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Disable custom (client-defined) tools when using DeepSeek","Switch to a provider/model that supports custom tool input"],"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-14T00:17:10.932Z"}