Skip to content

[Bug] zen/go model compatibility in Anthropic /v1/messages for coding-agent tool use #34331

Closed as not planned

Description

@lixinjie97

[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-max works with tool calls.
  • glm-5.2 succeeds for plain text but fails when tools are included.
  • kimi-k2.7-code and deepseek-v4-pro fail 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.2
  • kimi-k2.7-code
  • deepseek-v4-pro
  • qwen3.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 200
  • qwen3.7-max -> HTTP 200
  • kimi-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 200
  • glm-5.2 -> HTTP 401 with message similar to API key invalid
  • kimi-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-max on the same endpoint.
  • glm-5.2 succeeds 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:

  1. Plain text requests should work consistently, or return a clear unsupported-feature error.
  2. 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.2
  • kimi-k2.7-code
  • deepseek-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.

Activity

  1. github-actions commented on Jun 28, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Please 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.

  2. sdadz-luo commented on Aug 13, 2026

    @sdadz-luo

    Adding real-world impact from Claude Code (Anthropic-compatible agent client) — this bug makes deepseek-v4-pro completely unusable for us:

    Setup: Claude Code with ANTHROPIC_BASE_URL=https://opencode.ai/zen/go, model mapped to deepseek-v4-pro. Claude Code strips the [1M] suffix, so the actual request model is deepseek-v4-pro.

    Symptom: Every request with the standard tool set fails deterministically (100% repro):

    400 Error from provider (Console Go): Upstream request failed: [invalid_request_error] Failed to deserialize the JSON body into the target type: tools[0].function: missing field `name`
    

    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-pro also fail with Empty input messages (see #42091) — the Anthropic /v1/messages adapter mishandles both string content and tool conversion for this model.

    Impact: deepseek-v4-pro is advertised in GET /v1/models but 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/messages adapter for deepseek-v4-pro, or surface it as unsupported in model capability metadata.

  3. github-actions commented on Oct 13, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions