feat(codex): add OpenCode Go provider preset#3534
Conversation
OpenCode Go endpoint (https://opencode.ai/zen/go) requires /v1 suffix for OpenAI-compatible requests. Without it, requests fail with HTTP 404 because the base URL mapped to /chat/completions instead of /v1/chat/completions. Since the endpoint normalization behavior cannot be changed without potentially breaking other providers, a dedicated preset with the correct /v1 base URL is added instead. Closes farion1231#3528
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0afc5f744a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| codexChatReasoning: { | ||
| supportsThinking: true, | ||
| thinkingParam: "thinking", | ||
| outputFormat: "reasoning_content", | ||
| }, |
There was a problem hiding this comment.
Preserve DeepSeek effort settings for OpenCode Go
For this preset, the explicit codexChatReasoning object short-circuits backend inference in resolve_codex_chat_reasoning_config, and normalizeCodexChatReasoningForSave treats the omitted supportsEffort as false/effortParam: "none". That means OpenCode Go's DeepSeek V4 models will ignore Codex's configured model_reasoning_effort = "high", even though the adjacent DeepSeek preset for the same model family enables supportsEffort: true with effortValueMode: "deepseek"; users selecting OpenCode Go will silently lose effort control unless these fields are included here.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is an intentional design, as OpenCode Go will include models from other providers, and adding supportsEffort might be incompatible with other providers.
|
OpenCode Go 是异构聚合服务,不是一个行为稳定的单一 OpenAI Chat provider(这家应该是采购api + 自己租卡卖token 混着来的),已预感到即将 会有 一大波 issue 丢个截图问,“为什么我用了 ccs 里 opencode go 的预设 codex 还是不能用啊!” (无恶意,只是想到这个语义下可能会被人误解做了 preset 就会被认为 做了全部的兼容支持,但很显然完美兼容 opencode go是一件roi 较低的事情) |
|
是的,这也是 CCS 目前没有 OpenCode GO 支持的原因
Ika Firmansyah Susanto ***@***.***> 于2026年6月2日周二 17:46写道:
… *lovingfish* left a comment (farion1231/cc-switch#3534)
<#3534 (comment)>
OpenCode Go 是异构聚合服务,不是一个行为稳定的单一 OpenAI Chat provider(这家应该是采购api +
自己租卡卖token 混着来的),已预感到即将 会有 一大波 issue 丢个截图问,“为什么我用了 ccs 里 opencode go 的预设
codex 还是不能用啊!” (无恶意,只是想到这个语义下可能会被人误解做了 preset 就会被认为 做了全部的兼容支持,但很显然完美兼容
opencode go是一件roi 较低的事情)
—
Reply to this email directly, view it on GitHub
<#3534?email_source=notifications&email_token=AKW3RFAABK7HI4DLHMCD5VD452O6PA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRQGEYTKOBSGYZ2M4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4601158263>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKW3RFC2FWL3GEV34S2LXD3452O6PAVCNFSM6AAAAACZV5U7UGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DMMBRGE2TQMRWGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Summary / 概述
Add OpenCode Go as a Codex provider preset to fix endpoint path resolution.
Problem / 根因
When using the same base URL (
https://opencode.ai/zen/go) as the OpenCode Go preset in Claude Code, requests work correctly in Claude Code but fail with upstream HTTP 404 in Codex.The root cause is in
forwarder.rs: two endpoint rewrite functions output inconsistent paths for the same upstream target (Chat Completions API):target_pathrewrite_codex_responses_endpoint_to_chat/chat/completionsrewrite_claude_transform_endpoint/v1/chat/completionsThe Codex side is missing
/v1, which causesCodexAdapter::build_urlto treathttps://opencode.ai/zen/goas a custom prefix and not prepend/v1. The request ultimately lands on/zen/go/chat/completions. On the Claude side, the endpoint already carries/v1, soClaudeAdapter::build_urldirectly concatenates to produce the correct path/zen/go/v1/chat/completions.Since fixing Codex-side path normalization globally could break other providers, a dedicated preset with the correct
/v1suffix in the base URL is added instead.Changes / 变更
src/config/codexProviderPresets.ts— one new preset entry after DeepSeek:opencode_gohttps://opencode.ai/zen/go/v1deepseek-v4-flashopenai_chatdeepseek-v4-flash,deepseek-v4-proreasoning_contentRelated Issue / 关联 Issue
#3528
Checklist / 检查清单
pnpm typecheckpassespnpm format:checkpasses