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
{{ message }}
Repository navigation
Bug: 'Invalid request body' with github-copilot/gemini-3-pro-preview model #5161
When using the opencode CLI with the github-copilot/gemini-3-pro-preview model, the tool fails with an "invalid request body" error.
Environment
OS: Linux
opencode version: Standalone binary installation located at /home/dani/.opencode/bin/opencode.
Steps to Reproduce
Configure the opencode CLI to use github-copilot/gemini-3-pro-preview as the model.
Run a command that invokes the model (e.g., opencode "your prompt here").
The request fails with an "invalid request body" error from the upstream API.
Investigation Details
During a debugging session, the following was determined:
The issue appears to stem from the opencode-gemini-auth plugin, which is bundled within the standalone binary.
This plugin transforms requests for Gemini models to a format expected by the cloudcode-pa.googleapis.com endpoint.
This transformation seems to be incorrectly applied to the github-copilot/gemini-3-pro-preview model, causing the API to reject the request body.
Since the opencode installation is a single binary, it was not possible to patch the bundled plugin code to bypass this transformation for the specific model.
Attempts to override the behavior via opencode.json configuration were also unsuccessful.
Suggested Fix
The opencode-gemini-auth plugin should likely not apply its specific request body transformation when the model is github-copilot/gemini-3-pro-preview. The request should be passed through to the standard Gemini API endpoint without modification.
Activity
github-actions commentedon Dec 6, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if your specific case differs from these.
dani931004 commentedon Dec 6, 2025
Closing as a duplicate of #4816 and #4468. All relevant context will be added to the existing threads.