zed-industries/zed · error

DeepSeek does not support custom tool calls

Error message

DeepSeek does not support custom tool calls

What it means

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.

Source

Thrown at crates/language_models/src/provider/deepseek.rs:410

                                tool_calls: Vec::new(),
                                reasoning_content: current_reasoning.take(),
                            },
                            Role::System => deepseek::RequestMessage::System { content: text },
                        });
                    }
                }
                MessageContent::Thinking { text, .. } => {
                    // Accumulate reasoning content for next assistant message
                    current_reasoning.get_or_insert_default().push_str(&text);
                }
                MessageContent::RedactedThinking(_) => {}
                MessageContent::Image(_) => {}
                MessageContent::Compaction(_) => {}
                MessageContent::ToolUse(tool_use) => {
                    let input = tool_use
                        .input
                        .as_json()
                        .ok_or_else(|| anyhow!("DeepSeek does not support custom tool calls"))?;
                    let tool_call = deepseek::ToolCall {
                        id: tool_use.id.to_string(),
                        content: deepseek::ToolCallContent::Function {
                            function: deepseek::FunctionContent {
                                name: tool_use.name.to_string(),
                                arguments: serde_json::to_string(input).unwrap_or_default(),
                            },
                        },
                    };

                    if let Some(deepseek::RequestMessage::Assistant { tool_calls, .. }) =
                        messages.last_mut()
                    {
                        tool_calls.push(tool_call);
                    } else {
                        messages.push(deepseek::RequestMessage::Assistant {
                            content: None,
                            tool_calls: vec![tool_call],

View on GitHub (pinned to f4178619ac)

Solutions

  1. Disable custom (client-defined) tools when using DeepSeek
  2. Switch to a provider/model that supports custom tool input
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/language_models/src/provider/deepseek.rs:410 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20). Data as JSON: /api/errors/1b858c60263a22c6. Report an issue: GitHub.