You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the report. I traced this through the proxy: opencodex sends the bare DeepSeek model id to https://opencode.ai/zen/go/v1/chat/completions (same openai-chat path the working opencode-go models use). On a non-2xx upstream response it only prefixes the upstream body with Provider error 400: — the nested Error from provider (Console Go): Upstream request failed is produced by OpenCode Go itself, not by opencodex.
I also ran a live request through a local proxy just now with opencode-go/deepseek-v4-flash (high reasoning) and it completed with HTTP 200, so the endpoint/model-id/reasoning path isn't universally broken on current opencodex. An identical DeepSeek-only failure was reported directly against OpenCode in anomalyco/opencode#36157, which points at an intermittent OpenCode Go backend/account issue rather than a deterministic opencodex bug — consistent with the comment above saying it works for them.
Could you retry and share: your ocx --version, the exact DeepSeek model, the selected reasoning effort, and whether it fails on the first prompt or only after a tool call? A timestamp from the opencodex request log would also help correlate. If a minimal direct OpenCode Go API request with the same key also 400s, it's upstream and worth reporting there; if direct works but opencodex fails only at a specific effort or after tool results, that narrows it to something we can fix here.
Fixed in 8942c7c (dev), shipping with the next release.
Root cause — this was an opencodex bug after all, specific to DeepSeek on opencode-go. DeepSeek V4 thinking mode has a hard API contract: every assistant turn that contains tool_calls must be replayed with its original reasoning_content in subsequent requests, or the API rejects the request (thinking-mode docs). The openai-chat adapter only replays reasoning_content for models listed in the provider's preserveReasoningContentModels, and the opencode-go registry entry listed GLM/Kimi but not deepseek-v4-pro/deepseek-v4-flash (the direct deepseek provider already had them — which is why direct DeepSeek worked). So the first prompt would succeed, and the turn right after any tool call would 400 with the upstream error you saw. This matches how OpenCode itself (anomalyco/opencode@923af96), LiteLLM, and Roo Code fixed the same failure.
Fix (src/providers/registry.ts): opencode-go now preserves reasoning_content for DeepSeek V4 models and maps Codex reasoning efforts onto DeepSeek's accepted values (xhigh→max etc.) instead of sending them literally. Regression tests added in tests/opencode-go-deepseek.test.ts.
Note: first-prompt failures with the same message can still be an OpenCode Go backend blip (there were Go-side DeepSeek outages around Jul 5-9, e.g. anomalyco/opencode#35486/#36157) — those recover on their own and aren't client-fixable. If you still see a 400 on the very first prompt after updating, it's upstream; please reopen if it persists after a tool call.
First of all, thank you for your efforts and this beautiful repo.
I considered that it can be caused by the server not your proxy. But, i tried it via another proxy (it is not working perfectly so i didn't go with it but it responds). I also tried in different days and hour with no difference.
After i got your response i update ocx but still doesn't work. After all, i will send this issue to opencode repo although i'm semi-sure it works properly (like it does with other proxies or via opencode cli).
(sorry for any sentence that doesn't make sense. i'm not English-native)
interesting note i just noticed that it works for codex cli but not desktop app.
to give you full view, i'm using linux. i installed it via codex-disktop-linux
While it is not official but it works the same as linux and i didn't face any issue. all other models work what makes sure it is not related to this codex version.
Activity
Wibias commentedon Jul 9, 2026
Nope, thats on ur side. Mine works.
lidge-jun commentedon Jul 10, 2026
Thanks for the report. I traced this through the proxy: opencodex sends the bare DeepSeek model id to
https://opencode.ai/zen/go/v1/chat/completions(sameopenai-chatpath the working opencode-go models use). On a non-2xx upstream response it only prefixes the upstream body withProvider error 400:— the nestedError from provider (Console Go): Upstream request failedis produced by OpenCode Go itself, not by opencodex.I also ran a live request through a local proxy just now with
opencode-go/deepseek-v4-flash(high reasoning) and it completed with HTTP 200, so the endpoint/model-id/reasoning path isn't universally broken on current opencodex. An identical DeepSeek-only failure was reported directly against OpenCode in anomalyco/opencode#36157, which points at an intermittent OpenCode Go backend/account issue rather than a deterministic opencodex bug — consistent with the comment above saying it works for them.Could you retry and share: your
ocx --version, the exact DeepSeek model, the selected reasoning effort, and whether it fails on the first prompt or only after a tool call? A timestamp from the opencodex request log would also help correlate. If a minimal direct OpenCode Go API request with the same key also 400s, it's upstream and worth reporting there; if direct works but opencodex fails only at a specific effort or after tool results, that narrows it to something we can fix here.fix(opencode-go): replay DeepSeek V4 reasoning_content on tool-call t…
lidge-jun commentedon Jul 10, 2026
Fixed in 8942c7c (dev), shipping with the next release.
Root cause — this was an opencodex bug after all, specific to DeepSeek on opencode-go. DeepSeek V4 thinking mode has a hard API contract: every assistant turn that contains
tool_callsmust be replayed with its originalreasoning_contentin subsequent requests, or the API rejects the request (thinking-mode docs). The openai-chat adapter only replaysreasoning_contentfor models listed in the provider'spreserveReasoningContentModels, and theopencode-goregistry entry listed GLM/Kimi but notdeepseek-v4-pro/deepseek-v4-flash(the directdeepseekprovider already had them — which is why direct DeepSeek worked). So the first prompt would succeed, and the turn right after any tool call would 400 with the upstream error you saw. This matches how OpenCode itself (anomalyco/opencode@923af96), LiteLLM, and Roo Code fixed the same failure.Fix (src/providers/registry.ts): opencode-go now preserves
reasoning_contentfor DeepSeek V4 models and maps Codex reasoning efforts onto DeepSeek's accepted values (xhigh→maxetc.) instead of sending them literally. Regression tests added in tests/opencode-go-deepseek.test.ts.Note: first-prompt failures with the same message can still be an OpenCode Go backend blip (there were Go-side DeepSeek outages around Jul 5-9, e.g. anomalyco/opencode#35486/#36157) — those recover on their own and aren't client-fixable. If you still see a 400 on the very first prompt after updating, it's upstream; please reopen if it persists after a tool call.
mostafa0658M commentedon Jul 10, 2026
First of all, thank you for your efforts and this beautiful repo.
I considered that it can be caused by the server not your proxy. But, i tried it via another proxy (it is not working perfectly so i didn't go with it but it responds). I also tried in different days and hour with no difference.
After i got your response i update ocx but still doesn't work. After all, i will send this issue to opencode repo although i'm semi-sure it works properly (like it does with other proxies or via opencode cli).
(sorry for any sentence that doesn't make sense. i'm not English-native)
mostafa0658M commentedon Jul 10, 2026
Models:
opencode-go/deepseek-v4-flash
opencode-go/deepseek-v4-pro
Efforts i tried: High, Extra High, Ultra
mostafa0658M commentedon Jul 10, 2026
interesting note i just noticed that it works for codex cli but not desktop app.
to give you full view, i'm using linux. i installed it via codex-disktop-linux
While it is not official but it works the same as linux and i didn't face any issue. all other models work what makes sure it is not related to this codex version.
fix(opencode-go): replay DeepSeek V4 reasoning_content on tool-call t…