anomalyco / anomalyco/opencode

Console Go relay: HTTP 400 (empty body) when request combines reasoning_content echo-back with reasoning_effort on deepseek-v4-flash

Open
#48,180 1 comment 0 reactions 1 assignee View on GitHub

@fwang is already working on this.

Since Sep 9, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Summary

POST https://opencode.ai/zen/go/v1/chat/completions with model=deepseek-v4-flash rejects requests that contain BOTH:

  • reasoning_content echo-back on historical assistant messages (required by DeepSeek-family thinking models when replaying tool-call turns), AND
  • any reasoning_effort value (low/medium/high)

The response is HTTP 400 with an empty error body:

{"object":"error","model":"deepseek-v4-flash"}

No message field, so it is impossible to tell what failed. For agents this is fatal: a long session with many tool calls hits this deterministically at some point and cannot recover.

Repro (bisect by replaying a captured request body)

Captured the failing request body from a real session and replayed it with the same x-opencode-session header:

Variant Result
Original body (24 assistant msgs with reasoning_content echo-back + reasoning_effort: high) HTTP 400 (same empty body)
Remove reasoning_effort HTTP 200
Remove reasoning_content echo-back, keep high HTTP 200
reasoning_effort: medium / low (full body) HTTP 400
Short request + high (no echo-back history) HTTP 200

So the trigger is the combination, not either field alone. Removing either side restores 200.

Expected

Either accept the combination (it is a valid OpenAI-compatible payload), or return a descriptive error message instead of a bare {"object":"error","model":...}.

I believe this is in the Console Go relay layer (the same endpoint serves other models fine; deepseek-v4-pro with the same combination is not affected per other reports). Happy to provide more details or a minimal repro script.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.