opencode
opencode copied to clipboard
Gemini 3 models hang due to conflicting thinkingConfig in smallOptions()
Description
When using gemini-3-pro-preview via the SDK, requests hang indefinitely. The same code works fine with gemini-2.0-flash.
Root cause: In packages/opencode/src/provider/transform.ts, smallOptions() returns { thinkingConfig: { thinkingBudget: 0 } } for all Google models (line 477-478). But options() sets { thinkingConfig: { thinkingLevel: "high" } } for gemini-3 models. When merged, Gemini 3 receives both parameters, which the API rejects.
Suggested fix:
if (model.providerID === "google") {
if (model.api.id.includes("gemini-3")) {
return { thinkingConfig: { thinkingLevel: "low" } }
}
return { thinkingConfig: { thinkingBudget: 0 } }
}
Plugins
None (using the sdk)
OpenCode version
1.0.223
Steps to reproduce
- Use
createOpencode()from@opencode-ai/sdk - Configure model as
gemini-3-pro-preview - Send a prompt
- Request hangs indefinitely
Operating System
macOS
Terminal
N/A (using the sdk)