Repository navigation
Description
Description
I use an active OpenCode Go subscription through Codex, with GPT-6 handling planning and opencode-go/deepseek-v4.1-flash handling delegated execution. Codex talks to Go through a local Codex Router → LiteLLM → API forwarder. Intermittent HTTP 400s now interrupt many tasks, often while a DeepSeek sub-agent is working. This was rare when I started using this setup about a week ago and has become frequent enough to affect nearly every conversation.
The client shows:
opencode rejected the request for DeepSeek V4.1 Flash (opencode Go). (HTTP 400: Error code: 400 - {'model': 'deepseek-v4.1-flash'})
My local router's LiteLLM error log also contains only Error code: 400 - {'model': 'deepseek-v4.1-flash'}. There is no field-level error message. Successful calls to the same model occur immediately before and after these failures. I do not see matching failed entries in the Go Console's Inference log, although it may omit requests rejected before inference.
Local evidence
For opencode-go/deepseek-v4.1-flash, my local request ledger recorded these HTTP 400 counts (UTC dates):
| Date | HTTP 400s |
|---|---|
| Sep 25 | 1 |
| Sep 26 | 4 |
| Sep 27 | 9 |
| Sep 28 | 4 |
| Sep 29, partial day | 2 |
Examples (UTC; IDs are local router request suffixes, not OpenCode request IDs):
- Sep 26 05:10:17,
:7356 - Sep 27 08:16:04,
:11051 - Sep 27 17:28:41,
:20746 - Sep 28 00:01:47,
:25679 - Sep 28 23:05:01,
:32591 - Sep 29 02:15:23,
:32833
The Sep 28 00:01:47 failure occurred on the model request following two image-tool results, but other image requests in that session succeeded. The issue also occurs in other task contexts, so I cannot attribute it to images. The local API forwarder is configured to add x-opencode-session for Go; I have not captured the actual outbound headers of a failing request.
Steps to reproduce
- Use a Go subscription and route Codex agent/sub-agent conversations to
deepseek-v4.1-flashthrough an OpenAI-compatible proxy. - Run multi-turn coding tasks with tools and delegated agents.
- Observe intermittent HTTP 400 responses with only
{'model': 'deepseek-v4.1-flash'}as the reported error, while adjacent requests succeed.
I do not yet have a deterministic minimal reproduction. Could you check whether these timestamps correspond to Go gateway rejections that are absent from the Inference log, and advise which response header/request ID we should capture? I would also welcome guidance on whether the gateway returns a more detailed error body than the one surfaced by LiteLLM. I can provide sanitized request metadata or additional timestamps privately.
Environment
- Client: Codex desktop on macOS, with GPT-6 root agents and DeepSeek V4.1 Flash delegated agents
- Provider/model: OpenCode Go /
deepseek-v4.1-flash - Transport: Codex Router → LiteLLM → local API forwarder → OpenCode Go
chat/completions - OpenCode CLI: not used for these requests
Activity
github-actions commentedon Sep 29, 2026
This issue might be a duplicate of existing issues. Please check:
{"model":"deepseek-v4.1-flash"}.SamSpiri commentedon Sep 29, 2026
Your side of this is Codex → LiteLLM → forwarder rather than OpenCode, so the OpenCode plugin below will not apply to you directly — but the retry policy it encodes is the general shape, and invites testers from the OpenCode side:
https://github.com/SamSpiri/opencode-go-stub-400-retry
Treat the bare-body rejection (status 400, JSON object containing only
model, noerror/message) as transient and retry it a couple of times with backoff; keep any 400 that carries a real reason terminal. That is a mirror of the guard you already have working, and your ledger is the best evidence in this thread that the classification is worth flipping.One observation relevant to triage here: your daily counts (1, 4, 9, 4, 2) with successes immediately before and after, and nothing matching in the Console Inference log, look like a flaky-route/replica signature rather than a verdict on the payload — consistent with #51201's byte-identical 200/400/200 replay. That suggests the per-request outcome is not determined by your prompt, which is also why a client-side retry should recover it.
If you do test the equivalent in LiteLLM, a note here on whether it recovers would help — it would be a second stack confirming the retryability claim.
Bigbrotha12 commentedon Sep 30, 2026
Adding another datapoint — same symptom on opencode v2.0.18 with the default OpenCode Go provider using
opencode-go/deepseek-v4.1-flash.The server log shows the failure surfaces while draining the session (i.e., sending the compiled request back to the provider), as
AI.Error.InvalidRequestwith no provider body:The recurring theme across the related issues (#51530, #50446, #51201, #50761) is that opencode-go returns an opaque 400 and opencode surfaces only the status code — so it's impossible to tell whether this is an upstream DeepSeek rejection, a context-limit edge case, or a gateway bug. Passing through the provider's response body (even raw) would help a lot in triaging.
Environment: opencode v2.0.18, Fedora 43 x86_64 (Linux 7.2.7-100.fc43), alacritty/truecolor, latest channel, no plugins.
neriousy commentedon Oct 20, 2026
Thanks for the report. We're tracking this same intermittent DeepSeek V4.1 Flash HTTP 400 response containing only the model name in #51201, so I'm closing this as a duplicate. Please follow that issue for updates.