Gemini 3 models hang due to conflicting thinkingConfig in smallOptions() #4195

Open
opened 2026-02-16 17:42:59 -05:00 by yindo · 4 comments
Owner

Originally created by @kevoconnell on GitHub (Jan 4, 2026).

Originally assigned to: @rekram1-node on GitHub.

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

  1. Use createOpencode() from @opencode-ai/sdk
  2. Configure model as gemini-3-pro-preview
  3. Send a prompt
  4. Request hangs indefinitely

Operating System

macOS

Terminal

N/A (using the sdk)

Originally created by @kevoconnell on GitHub (Jan 4, 2026). Originally assigned to: @rekram1-node on GitHub. ### 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:** ```typescript 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 1. Use `createOpencode()` from `@opencode-ai/sdk` 2. Configure model as `gemini-3-pro-preview` 3. Send a prompt 4. Request hangs indefinitely ### Operating System macOS ### Terminal N/A (using the sdk)
Author
Owner

@rekram1-node commented on GitHub (Jan 4, 2026):

I just merged a fox for this earlier today, think its fixed in next release

@rekram1-node commented on GitHub (Jan 4, 2026): I just merged a fox for this earlier today, think its fixed in next release
Author
Owner

@kevoconnell commented on GitHub (Jan 4, 2026):

ok sick sounds good @rekram1-node 🫡 , jw when do you think the next release will be?

@kevoconnell commented on GitHub (Jan 4, 2026): ok sick sounds good @rekram1-node 🫡 , jw when do you think the next release will be?
Author
Owner

@rekram1-node commented on GitHub (Jan 4, 2026):

later today or tmr morn

@rekram1-node commented on GitHub (Jan 4, 2026): later today or tmr morn
Author
Owner

@kevoconnell commented on GitHub (Jan 4, 2026):

sounds great thank you so much @rekram1-node 😄

@kevoconnell commented on GitHub (Jan 4, 2026): sounds great thank you so much @rekram1-node 😄
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4195