Repository navigation
Closed as not planned
Closed as not planned
Copy link
Description
[Bug] zen/go model compatibility in Anthropic /v1/messages for coding-agent tool use
Summary
Using OpenCode zen/go with Anthropic-compatible POST /v1/messages in coding-agent workflows, model behavior is inconsistent:
qwen3.7-maxworks with tool calls.glm-5.2succeeds for plain text but fails when tools are included.kimi-k2.7-codeanddeepseek-v4-profail on message/tool schema handling.
This breaks stable model switching for agent clients (Claude Code style workloads with tools).
Environment
- Endpoint:
https://opencode.ai/zen/go - Auth header that works for this key:
x-api-key: <redacted> - API style tested: Anthropic-compatible
/v1/messages - Date: 2026-06-29
Confirmed model availability
GET /v1/models returns these IDs (among others):
glm-5.2kimi-k2.7-codedeepseek-v4-proqwen3.7-max
Reproduction
1) Plain text request (no tools)
curl -sS -X POST 'https://opencode.ai/zen/go/v1/messages' \
-H 'Content-Type: application/json' \
-H "x-api-key: <redacted>" \
-d '{
"model":"glm-5.2",
"max_tokens":48,
"messages":[{"role":"user","content":"hello"}]
}'Observed:
glm-5.2-> HTTP 200qwen3.7-max-> HTTP 200kimi-k2.7-code-> HTTP 400 (messages must not be empty)deepseek-v4-pro-> HTTP 400 (Empty input messages)
2) Tool-call request (Anthropic tools shape)
curl -sS -X POST 'https://opencode.ai/zen/go/v1/messages?beta=true' \
-H 'Content-Type: application/json' \
-H "x-api-key: <redacted>" \
-d '{
"model":"glm-5.2",
"max_tokens":96,
"messages":[{"role":"user","content":"Please call calc for 1+1"}],
"tools":[{
"name":"calc",
"description":"simple calculator",
"input_schema":{
"type":"object",
"properties":{"a":{"type":"number"},"b":{"type":"number"}},
"required":["a","b"]
}
}]
}'Observed:
qwen3.7-max-> HTTP 200glm-5.2-> HTTP 401 with message similar toAPI key invalidkimi-k2.7-code-> HTTP 400 (function name is invalid ...)deepseek-v4-pro-> HTTP 400 (tools[0].function missing field name)
Why this seems like a gateway/model-adapter issue
- Same key works for
qwen3.7-maxon the same endpoint. glm-5.2succeeds for plain text but fails when tools are present.- Error patterns on kimi/deepseek point to request translation/schema mapping incompatibility.
- For clients that rely on Anthropic
/messages+ tools, model IDs become listed-but-not-usable.
Expected behavior
For all listed Zen/Go model IDs that are advertised as available:
- Plain text requests should work consistently, or return a clear unsupported-feature error.
- Tool-call requests should either:
- work with Anthropic tools format, or
- fail with an explicit capability error (not auth-like or malformed-schema downstream errors).
Requested fix
Please normalize the Anthropic /v1/messages adapter across these models, especially for tool-call payloads:
glm-5.2kimi-k2.7-codedeepseek-v4-pro
If a model does not support Anthropic tools on Zen/Go, please expose that in model capability metadata and return a deterministic unsupported-tools error.
Metadata
Metadata
Assignees
Labels
No labels
Activity
github-actions commentedon Jun 28, 2026
This issue might be a duplicate of existing issues. Please check:
/zen/gobridge and "function name is invalid" error pattern you observed withkimi-k2.7-codePlease review these issues and add a comment or cross-reference if your report overlaps. If your issue covers distinct models or a different root cause, it is still worth keeping open, but the maintainers may consolidate.
sdadz-luo commentedon Aug 13, 2026
Adding real-world impact from Claude Code (Anthropic-compatible agent client) — this bug makes
deepseek-v4-procompletely unusable for us:Setup: Claude Code with
ANTHROPIC_BASE_URL=https://opencode.ai/zen/go, model mapped todeepseek-v4-pro. Claude Code strips the[1M]suffix, so the actual request model isdeepseek-v4-pro.Symptom: Every request with the standard tool set fails deterministically (100% repro):
Control test: Same client, same tool set,
deepseek-v4-flash→ works fine. This confirms the gateway adapter is broken for pro only.Related: Plain-text requests to
deepseek-v4-proalso fail withEmpty input messages(see #42091) — the Anthropic/v1/messagesadapter mishandles both string content and tool conversion for this model.Impact:
deepseek-v4-prois advertised inGET /v1/modelsbut is unusable from any Anthropic-protocol agent client (Claude Code, etc.) since at least June 28 (#34331). Flash works, but users who need pro have no workaround.Please prioritize normalizing the Anthropic
/v1/messagesadapter fordeepseek-v4-pro, or surface it as unsupported in model capability metadata.github-actions commentedon Oct 13, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.