anomalyco / anomalyco/opencode
BUG: `deepseek-v4-pro` on zen/go `/v1/messages` returns 400 `Empty input messages` for string content (flash works on same request)
@fwang is already working on this.
Since Aug 12, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
On the OpenCode Zen gateway https://opencode.ai/zen/go, the Anthropic-compatible endpoint POST /v1/messages fails for deepseek-v4-pro when messages[].content is passed as a string. The exact same request with deepseek-v4-flash returns 200 OK. Switching deepseek-v4-pro to the array form of content also works.
This only affects deepseek-v4-pro on the Anthropic endpoint — the OpenAI-compatible endpoint and deepseek-v4-flash are unaffected.
Environment
| Item | Value |
|---|---|
| Gateway endpoint | https://opencode.ai/zen/go |
| Failing endpoint | POST /v1/messages (Anthropic-compatible) |
| API version header | anthropic-version: 2023-06-01 |
| Failing model | deepseek-v4-pro |
| Control model | deepseek-v4-flash (same request returns 200) |
| Auth | x-api-key: <token> |
Reproduction
# Fails: 400 Empty input messages
curl -s https://opencode.ai/zen/go/v1/messages \
-H "x-api-key: $KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"deepseek-v4-pro","max_tokens":30,"messages":[{"role":"user","content":"hi"}]}'
# Control: same request with deepseek-v4-flash returns 200 OK
curl -s https://opencode.ai/zen/go/v1/messages \
-H "x-api-key: $KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"deepseek-v4-flash","max_tokens":30,"messages":[{"role":"user","content":"hi"}]}'
Error response
{
"error": {
"param": null,
"type": "invalid_request_error",
"code": "invalid_request_error",
"message": "Error from provider (Console Go): Upstream request failed: [invalid_request_error] Empty input messages"
}
}
The error is thrown by the Console Go upstream provider.
Test matrix (same endpoint, same payload, only the model changes)
| Case | deepseek-v4-flash |
deepseek-v4-pro |
|---|---|---|
Anthropic /v1/messages + string content |
200 OK | 400 Empty input messages |
Anthropic /v1/messages + array content |
200 OK | 200 OK |
OpenAI /v1/chat/completions + string content |
200 OK | 200 OK |
Anthropic /v1/messages + stream + array content |
— | 200, SSE works |
Exact trigger condition
- Endpoint: only the Anthropic-compatible
/v1/messages - Model: only
deepseek-v4-pro(same request works fordeepseek-v4-flash) - Trigger:
messages[].contentis a string ("content":"hi"); the array form ("content":[{"type":"text","text":"hi"}]) works
Impact
The Anthropic SDK accepts a string shorthand for content, e.g. client.messages.create(model="deepseek-v4-pro", messages=[{"role":"user","content":"hi"}]). Serialized as string content, this directly triggers the 400. Any string-content Anthropic-SDK call to deepseek-v4-pro fails, while deepseek-v4-flash or the array form does not.
Related
This overlaps with #34331 (same deepseek-v4-pro error observed there), but that issue is broader and predates this specific flash-vs-pro contrast. This report isolates the deepseek-v4-pro-only regression against a working control model.
Workaround: pass content as the array form [{"type":"text","text":"..."}] for deepseek-v4-pro.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.