Skip to content

Gemini 3 integration fail #6050

Closed
Closed

Description

@ceo-s

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

Activity

  1. github-actions commented on Dec 23, 2025

    @github-actions
    Contributor

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

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

  2. longsman commented on Dec 23, 2025

    @longsman

    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:
    vercel/ai#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.

  3. palekiwi commented on Dec 24, 2025

    @palekiwi

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

  4. rekram1-node commented on Dec 24, 2025

    @rekram1-node
    Contributor

    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

  5. rmk40 commented on Dec 24, 2025

    @rmk40
    Contributor

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

  6. kaitokid2302 commented on Dec 25, 2025

    @kaitokid2302

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

  7. longsman commented on Dec 26, 2025

    @longsman

    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

  8. rekram1-node commented on Dec 26, 2025

    @rekram1-node
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions