Repository navigation
OpenCode Go Gemini 4 Argon Contributor is routed to Chat Completions instead of Gemini #7097
Description
Client or integration
Codex App
Provider or upstream service
OpenCode Go (opencode-go/gemini-4-argon-contributor)
OpenCodex version
2.84.0
Endpoint or capability
POST /v1/responses inbound; model-specific upstream protocol selection for OpenCode Go's Gemini endpoint.
Current behaviour
OpenCodex advertises opencode-go/gemini-4-argon-contributor in the Codex model picker. Selecting it and sending a prompt fails immediately with HTTP 400, Model does not support this protocol.
The request trace shows that OpenCodex accepts the Responses request, selects the opencode-go provider, then translates responses -> ir -> chat and sends it through adapter: "openai-chat". The local opencode-go configuration has a provider-wide openai-chat adapter and https://opencode.ai/zen/go/v1 base URL. A second attempt with reasoning effort high failed identically to the first attempt at xhigh, so the reasoning level is not the cause.
Expected behaviour
This model should use OpenCode Go's documented Gemini endpoint and Gemini request/response wire while other Go models retain their own protocols. If that route is not implemented, OpenCodex should not advertise the model as callable through the current provider configuration.
Minimal redacted request or reproduction
- Configure the built-in
opencode-goprovider with a Go subscription key. No custom model adapter override is set. - In Codex App, select
opencode-go/gemini-4-argon-contributorand send a simple prompt. - Inspect the OpenCodex request log. The model is selected, but the upstream attempt uses
openai-chatand fails with 400.
Redacted relevant configuration:
{
"providers": {
"opencode-go": {
"adapter": "openai-chat",
"baseUrl": "https://opencode.ai/zen/go/v1",
"authMode": "key"
}
}
}Actual response or error
status: 400
upstreamError: Provider error 400: Model does not support this protocol.
attempt.adapter: openai-chat
protocolTrace.inbound: responses
protocolTrace.upstream: chat
protocolTrace.requestPath: responses -> ir -> chat
failureStage: headers-only
failureCause: payload-rejected
Upstream documentation
OpenCode Go lists Gemini 4 Argon Contributor (gemini-4-argon-contributor) on the Gemini model endpoint with @ai-sdk/google, unlike its Chat Completions models: https://opencode.ai/docs/go/#endpoints
Suggested mapping or implementation notes
Code inspection on dev at 08bb2e4 narrows the fix to two coupled changes:
- Select a trusted, exact-model Gemini route. The Go registry entry defaults to
openai-chatand has exact-model Responses exceptions, but none for Gemini. Adding"gemini-4-argon-contributor": "google"tomodelWireDefaultsalone does not work: wire resolution and the static policy resolver allow onlyopenai-chatandopenai-responsesfor these defaults. Keep the user-configurablemodelAdaptersallowlist narrow; add a trusted registry/hard-pin path for this exact model. Scope it to the canonical Go destination and key-auth configuration, so a custom same-named provider cannot send its credential to the Go endpoint. - Provide a Go-specific Gemini transport. The Google adapter currently constructs an AI Studio
/v1beta/models/<id>:generateContentpath. OpenCode Go documents/inference/go/v1/models/gemini-4-argon-contributor; the selected adapter needs to build that Go path forgenerateContentandstreamGenerateContent, using the Go credential contract without changing AI Studio or Antigravity traffic. The existing Go session-header helper should continue to carryx-opencode-sessionafter wire selection.
Regression coverage should assert the outgoing Gemini URL, request wire, authentication/session headers, streaming completion and one tool-result continuation; it should also show that sibling Go Chat/Responses/Messages models are unchanged and that a custom destination cannot trigger the Go-specific route.
The wrong URL/protocol is confirmed by the trace and code. The generic Google adapter uses x-goog-api-key, but this report has not established that OpenCode Go rejects that header; the auth behavior should be verified against the Go endpoint rather than assumed. OpenCodex already has model-specific Go wire precedents in #1482 and #4847.
Additional context
Related: #1482 (Go Luna routed to the wrong protocol; fixed), #4847 (per-model Go Messages exception; fixed). This report is specifically about the Go Gemini endpoint.
Checks
- I searched existing provider and compatibility issues.
- The request and response above omit credentials, account details, request IDs, conversation IDs, and personal data.
- The expected protocol is based on OpenCode Go's published endpoint table.
Activity
DaveW001 commentedon Oct 14, 2026
I can confirm this independently.
OpenCodex 2.83.0 on Windows, requests through the proxy's loopback Responses endpoint. Every call for
opencode-go/gemini-4-argon-contributorcomes back with 400 "Model does not support this protocol." It happened multiple times today, streamed and non-streamed, and the raw upstream body on some of them is{"type":"error","error":{"type":"ModelProtocolUnsupported"}}.My traces show adapter
openai-chat,failureStage: headers-only,failureCause: payload-rejected, and a protocol trace flagging a cross-wire translation from responses to chat.Two controls from the same key in the same window:
opencode-go/deepseek-v4.1-flashreturns 200, andgoogle/gemini-4-argonreturns 200. So this is routing, not quota or credentials. I also could not find a per-model adapter override to work around it locally.Thanks for the fix. I am happy to run a patched build against my setup if another environment helps.
Ingwannu commentedon Oct 16, 2026
The native Gemini routing fix is proposed in #7099 and is being integrated with the OpenCode Zen work in #7216. This matches the reported Chat-adapter/protocol mismatch; the working DeepSeek route is a useful control, not proof that the Gemini wire is already fixed.
The bundle is still open and its exact-head remote validation is pending in the description. Keeping this report open until dev contains the accepted fix; no live key/model request was made in this pass.
fix(providers): carry Zed, Qoder, and OpenCode Gemini compatibility (#…
lidge-jun commentedon Oct 16, 2026
Fixed on dev in f997eb8 via #7216 (carry of #7099 by @souljorje: OpenCode Go Gemini now uses the native Gemini wire).