You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[OpenCode Go] deepseek-v4-pro Anthropic proxy tool format broken: tools[0].function missing name #24224
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
I am encountering the same issue.
I am using GitHub Copilot CLI 1.0.36 on Ubuntu 24.04 LTS.
In GitHub Copilot CLI, I have configured OpenCode Go's DeepSeek-V4-Flash as follows:
Below is the error message from GitHub Copilot CLI:
❯ Hello,
● Request failed (transient_bad_request). Retrying...
● Request failed (transient_bad_request). Retrying...
✗ 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
37386","type":"invalid_request_error","param":null,"code":"invalid_request_error"}}
For reference, it works normally when using the official DeepSeek API instead of going through OpenCode Go.
Quick update after re-checking the current OpenCode Go docs:
This looks less like a simple tools[0].function.name serialization bug now, and more like a protocol mismatch.
OpenCode Go currently documents deepseek-v4-pro and deepseek-v4-flash as OpenAI-compatible Chat Completions models:
endpoint: /v1/chat/completions
SDK/provider style: @ai-sdk/openai-compatible
while the MiniMax M2.x models are the ones documented as Anthropic Messages-compatible:
endpoint: /v1/messages
SDK/provider style: @ai-sdk/anthropic
So using Claude Code directly with OpenCode Go as an Anthropic-compatible ANTHROPIC_BASE_URL can break for DeepSeek V4: Claude Code sends Anthropic Messages/tool blocks, but the DeepSeek V4 path expects OpenAI-style chat completions, function/tool calls, and DeepSeek-specific reasoning_content replay in thinking/tool-call history.
DeepSeek V4 reasoning_content cache/replay for tool-call history
visible thinking block conversion for Claude Code
Since this is now better understood as a protocol-compatibility gap rather than the original narrow tools[0].function.name issue, I’m going to close this issue. Hopefully the bridge helps anyone who wants to keep using DeepSeek V4 from OpenCode Go inside Claude Code in the meantime.
Activity
github-actions commentedon Apr 24, 2026
This issue might be a duplicate of existing issues. Please check:
tools[0].namemissing field when using an OpenAI-compatible proxy — root cause may overlap with the tool format translation issue described here.ringotypowriter commentedon Apr 25, 2026
It seems like Chat Completion work
Even though the docs say using Anthropic.
Shine12222 commentedon Apr 25, 2026
I have the same promble too.
sh2 commentedon Apr 25, 2026
I am encountering the same issue.
I am using GitHub Copilot CLI 1.0.36 on Ubuntu 24.04 LTS.
In GitHub Copilot CLI, I have configured OpenCode Go's DeepSeek-V4-Flash as follows:
COPILOT_PROVIDER_TYPE=anthropic
COPILOT_PROVIDER_BASE_URL=https://opencode.ai/zen/go
COPILOT_MODEL=deepseek-v4-flash
COPILOT_PROVIDER_MAX_PROMPT_TOKENS=1000000
COPILOT_PROVIDER_MAX_OUTPUT_TOKENS=384000
Below is the error message from GitHub Copilot CLI:
For reference, it works normally when using the official DeepSeek API instead of going through OpenCode Go.
COPILOT_PROVIDER_TYPE=anthropic
COPILOT_PROVIDER_BASE_URL=https://api.deepseek.com/anthropic
COPILOT_MODEL=deepseek-v4-flash
COPILOT_PROVIDER_MAX_PROMPT_TOKENS=1000000
COPILOT_PROVIDER_MAX_OUTPUT_TOKENS=384000
wtq524176336-source commentedon Apr 25, 2026
I have the same promble too.
Senpaiarham04 commentedon Apr 25, 2026
I have the same problem with using opencode go, with claude code cli, :(
ixiqiu commentedon Apr 26, 2026
I also ran into this problem, and I'm going to change it to an OpenAI compatible format and try it again
superheroYu commentedon Apr 28, 2026
Quick update after re-checking the current OpenCode Go docs:
This looks less like a simple
tools[0].function.nameserialization bug now, and more like a protocol mismatch.OpenCode Go currently documents
deepseek-v4-proanddeepseek-v4-flashas OpenAI-compatible Chat Completions models:/v1/chat/completions@ai-sdk/openai-compatiblewhile the MiniMax M2.x models are the ones documented as Anthropic Messages-compatible:
/v1/messages@ai-sdk/anthropicSo using Claude Code directly with OpenCode Go as an Anthropic-compatible
ANTHROPIC_BASE_URLcan break for DeepSeek V4: Claude Code sends Anthropic Messages/tool blocks, but the DeepSeek V4 path expects OpenAI-style chat completions, function/tool calls, and DeepSeek-specificreasoning_contentreplay in thinking/tool-call history.I made a small local workaround for this:
https://github.com/superheroYu/deepseek-v4-opencode-claude-code-bridge.git
It acts as a local Anthropic Messages -> OpenAI-compatible Chat Completions bridge for Claude Code + OpenCode Go + DeepSeek V4. It handles:
/v1/messagesto OpenAI-compatible/v1/chat/completionstool_use/tool_result<-> OpenAItool_calls/toolmessagesreasoning_contentcache/replay for tool-call historySince this is now better understood as a protocol-compatibility gap rather than the original narrow
tools[0].function.nameissue, I’m going to close this issue. Hopefully the bridge helps anyone who wants to keep using DeepSeek V4 from OpenCode Go inside Claude Code in the meantime.References:
opencode: Model updates + thinking levels (zed-industries#54880)
opencode: Model updates + thinking levels (#54880) (cherry-pick to pr…
opencode: Model updates + thinking levels (zed-industries#54880)
opencode: Model updates + thinking levels (zed-industries#54880)
opencode: Model updates + thinking levels (#54880)
opencode: Model updates + thinking levels (zed-industries#54880)