Skip to content

[OpenCode Go] deepseek-v4-pro Anthropic proxy tool format broken: tools[0].function missing name #24224

@superheroYu

Description

@superheroYu

Title:
[OpenCode Go] deepseek-v4-pro: tools[0].function missing name in Anthropic proxy
Body:

Description

When using Claude Code with OpenCode Go as the Anthropic-compatible proxy
(ANTHROPIC_BASE_URL: https://opencode.ai/zen/go), the deepseek-v4-pro model
fails with a 400 error on any request involving tool calls:
API Error: 400 {"error":{"message":"Error from provider (DeepSeek): Failed
to deserialize the JSON body into the target type: tools[0].function: missing
field name at line 1 column 30415","type":"invalid_request_error"}}

Root cause

Claude Code sends Anthropic-format tools (flat: {name, description, input_schema}).
OpenCode Go translates them to DeepSeek's OpenAI format (nested: {type: "function",
function: {name, description, parameters}}). The function.name field gets dropped
in the translation, causing DeepSeek to reject the request.

What works

  • Direct DeepSeek official API: works
  • MiniMax through OpenCode Go: works
  • Only deepseek-v4-pro and deepseek-v4-flash through Go fail

Steps to reproduce

  1. Configure Claude Code with ANTHROPIC_BASE_URL: https://opencode.ai/zen/go
  2. Set ANTHROPIC_MODEL: deepseek-v4-pro
  3. Send a prompt that triggers a tool call (read file, search, etc.)
  4. 400 error immediately

Environment

  • Windows 11 / PowerShell
  • Claude Code via OpenCode Go proxy

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)windows

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions