Summary
Claude Code 2.1.252 sends thinking: {"budget_tokens": 0, "type": "adaptive"} on Anthropic-format requests. routatic-proxy forwards this verbatim to OpenCode Go's /zen/go/v1/messages, which returns 400 {"model":"qwen3.7-plus"} (and {"model":"qwen3.7-max"}), ultimately surfacing as 502 all models failed.
Repro
Against the proxy's /v1/messages with an Anthropic-path model (qwen3.7-plus via opencode-go):
curl -s http://127.0.0.1:3456/v1/messages \
-H "anthropic-version: 2023-06-01" -H "content-type: application/json" \
-d '{"model":"qwen3.7-plus","max_tokens":1000,"thinking":{"budget_tokens":0,"type":"adaptive"},"messages":[{"role":"user","content":"hi"}]}'
# → {"error":{"message":"all models failed","type":"api_error"}}
Controls:
- No
thinking field → succeeds.
"thinking": {"type":"enabled","budget_tokens":4000} → succeeds.
"thinking": {"budget_tokens":8000} (no type) → also fails.
Root cause
The thinking field with type: "adaptive" (or a bare budget_tokens) is passed through to OpenCode Go's Anthropic endpoint, which rejects it with HTTP 400.
Impact
Every real Claude Code agent (>= 2.1.252) sends adaptive thinking by default, so qwen3.7-plus / qwen3.7-max via opencode-go fail 100% on real multi-turn requests. CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1 does not help — it only affects Claude models (per Anthropic docs), and qwen is unaffected by it.
Expected
Either strip the thinking field when forwarding to OpenCode Go, or map type:"adaptive" → type:"enabled" with a sane budget_tokens. Ideally expose a config option to override request-level thinking so downstream users can force {"type":"enabled"}.
Environment
- routatic-proxy v0.6.5-beta.3 (linux-amd64)
- Claude Code 2.1.252
- Models:
qwen3.7-plus, qwen3.7-max (opencode-go)
Summary
Claude Code 2.1.252 sends
thinking: {"budget_tokens": 0, "type": "adaptive"}on Anthropic-format requests. routatic-proxy forwards this verbatim to OpenCode Go's/zen/go/v1/messages, which returns400 {"model":"qwen3.7-plus"}(and{"model":"qwen3.7-max"}), ultimately surfacing as502 all models failed.Repro
Against the proxy's
/v1/messageswith an Anthropic-path model (qwen3.7-plusviaopencode-go):Controls:
thinkingfield → succeeds."thinking": {"type":"enabled","budget_tokens":4000}→ succeeds."thinking": {"budget_tokens":8000}(notype) → also fails.Root cause
The
thinkingfield withtype: "adaptive"(or a barebudget_tokens) is passed through to OpenCode Go's Anthropic endpoint, which rejects it with HTTP 400.Impact
Every real Claude Code agent (>= 2.1.252) sends adaptive thinking by default, so
qwen3.7-plus/qwen3.7-maxviaopencode-gofail 100% on real multi-turn requests.CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1does not help — it only affects Claude models (per Anthropic docs), and qwen is unaffected by it.Expected
Either strip the
thinkingfield when forwarding to OpenCode Go, or maptype:"adaptive"→type:"enabled"with a sanebudget_tokens. Ideally expose a config option to override request-level thinking so downstream users can force{"type":"enabled"}.Environment
qwen3.7-plus,qwen3.7-max(opencode-go)