Gemini 3 integration fail #3793

Closed
opened 2026-02-16 17:41:30 -05:00 by yindo · 8 comments
Owner

Originally created by @ceo-s on GitHub (Dec 23, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

Gemini3 outputs JSON.

When Gemini3 models are used, everything they output is either thinking blocks or JSON instead of formatting it right.

Image Image

All Gemini models started acting weird

Sometimes it's ok and they do what i ask, sometimes they fail

This one went ok:

Image

This one failed

Image

OpenCode version

1.0.193

Steps to reproduce

  1. Open Opencode
  2. Add Google AI Studio API key
  3. Choose Gemini 3 Flash/Pro Preview model
  4. Prompt

Screenshot and/or share link

No response

Operating System

Arch linux

Terminal

Gnome Terminal

Originally created by @ceo-s on GitHub (Dec 23, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description # Gemini3 outputs JSON. ### When Gemini3 models are used, everything they output is either thinking blocks or JSON instead of formatting it right. <img width="1386" height="980" alt="Image" src="https://github.com/user-attachments/assets/1c9b3f34-111f-444e-b2c5-91d110e45bd2" /> <img width="1386" height="980" alt="Image" src="https://github.com/user-attachments/assets/4e9ac830-47e7-46b1-8dcd-546efdc931f5" /> # All Gemini models started acting weird ### Sometimes it's ok and they do what i ask, sometimes they fail ### This one went ok: <img width="1386" height="980" alt="Image" src="https://github.com/user-attachments/assets/fe7e3b55-4456-40a8-a8b3-0b2c75b427e1" /> ### This one failed <img width="1386" height="980" alt="Image" src="https://github.com/user-attachments/assets/0117640a-72c3-4d5f-8603-8c0331901963" /> ### OpenCode version 1.0.193 ### Steps to reproduce 1. Open Opencode 2. Add Google AI Studio API key 3. Choose Gemini 3 Flash/Pro Preview model 4. Prompt ### Screenshot and/or share link _No response_ ### Operating System Arch linux ### Terminal Gnome Terminal
yindo added the bug label 2026-02-16 17:41:30 -05:00
yindo closed this issue 2026-02-16 17:41:30 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 23, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #4954: google/gemini-3-pro-preview output formatting went off the rails - Reports similar output formatting issues where the model stops showing any formatting
  • #4632: Gemini 3 pro preview issues - Documents issues with google-vertex/gemini-3-pro-preview model behavior
  • #4832: [BUG]: Gemini 3 Pro function calling fails - missing thoughtSignature support - Addresses a critical issue where Gemini 3 Pro fails to handle function calling properly due to missing thoughtSignature preservation
  • #5832: Error with Gemini models when MCP enabled - Another Gemini model integration issue when MCP is enabled

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Dec 23, 2025): This issue might be a duplicate of existing issues. Please check: - #4954: google/gemini-3-pro-preview output formatting went off the rails - Reports similar output formatting issues where the model stops showing any formatting - #4632: Gemini 3 pro preview issues - Documents issues with google-vertex/gemini-3-pro-preview model behavior - #4832: [BUG]: Gemini 3 Pro function calling fails - missing `thoughtSignature` support - Addresses a critical issue where Gemini 3 Pro fails to handle function calling properly due to missing thoughtSignature preservation - #5832: Error with Gemini models when MCP enabled - Another Gemini model integration issue when MCP is enabled Feel free to ignore if none of these address your specific case.
Author
Owner

@longsman commented on GitHub (Dec 23, 2025):

I'll add some additional details - because the provider somehow makes a difference.
The OP's output format problems also happens with gemini 3 flash and gemini 3 pro, however:
Openrouter: no output issues for gemini 3 flash
Vercel AI gateway: no output issues for gemini 3 flash.
Opencode Zen: I experience nested json output, sometimes with full content, sometimes empty responses "{}"
I have not experimented with direct google's api provider.

Upon further investigation, I found:
https://github.com/vercel/ai/issues/11396
Which describes this issue upstream, and if I'm not mistaken, opencode zen uses this sdk, although I do no understand why Vercel AI gateway would not have this problem.

I'm having trouble weighing what to do here else just switch providers and wait for upstream.

EDIT: yeah keep an eye on that vercel issue someone making progress, probably best that this just gets resolved upstream.

@longsman commented on GitHub (Dec 23, 2025): I'll add some additional details - because the provider somehow makes a difference. The OP's output format problems also happens with gemini 3 flash and gemini 3 pro, however: Openrouter: no output issues for gemini 3 flash Vercel AI gateway: no output issues for gemini 3 flash. *Opencode Zen*: I experience nested json output, sometimes with full content, sometimes empty responses "{}" I have not experimented with direct google's api provider. Upon further investigation, I found: https://github.com/vercel/ai/issues/11396 Which describes this issue upstream, and if I'm not mistaken, opencode zen uses this sdk, although I do no understand why Vercel AI gateway would not have this problem. I'm having trouble weighing what to do here else just switch providers and wait for upstream. EDIT: yeah keep an eye on that vercel issue someone making progress, probably best that this just gets resolved upstream.
Author
Owner

@palekiwi commented on GitHub (Dec 23, 2025):

I can confirm that google/gemini-3-pro-preview (direct Google provider via API key) has also started outputting JSON

@palekiwi commented on GitHub (Dec 23, 2025): I can confirm that `google/gemini-3-pro-preview` (direct Google provider via API key) has also started outputting JSON
Author
Owner

@rekram1-node commented on GitHub (Dec 23, 2025):

I heard a variety of people report degraded performance from gemini models elsewhere, nothing we did has changed... That said I need to do gemini optimizations regardless

@rekram1-node commented on GitHub (Dec 23, 2025): I heard a variety of people report degraded performance from gemini models elsewhere, nothing we did has changed... That said I need to do gemini optimizations regardless
Author
Owner

@rmk40 commented on GitHub (Dec 24, 2025):

Another confirmation that this issue consistently occurs with the Gemini 3 models.

@rmk40 commented on GitHub (Dec 24, 2025): Another confirmation that this issue consistently occurs with the Gemini 3 models.
Author
Owner

@kaitokid2302 commented on GitHub (Dec 24, 2025):

This problem occurs for me too; please fix it soon.

@kaitokid2302 commented on GitHub (Dec 24, 2025): This problem occurs for me too; please fix it soon.
Author
Owner

@longsman commented on GitHub (Dec 25, 2025):

hey guys double check i believe it's resolved now. because of google. see the vercel issue I linked. @ceo-s see if its resolved

@longsman commented on GitHub (Dec 25, 2025): hey guys double check i believe it's resolved now. because of google. see the vercel issue I linked. @ceo-s see if its resolved
Author
Owner

@rekram1-node commented on GitHub (Dec 25, 2025):

Thank you @longsman it does indeed appear to be a google issue thank you for linking this!!!

@rekram1-node commented on GitHub (Dec 25, 2025): Thank you @longsman it does indeed appear to be a google issue thank you for linking this!!!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3793