google/gemini-3-pro-preview output formatting went off the rails #3236

Open
opened 2026-02-16 17:39:16 -05:00 by yindo · 5 comments
Owner

Originally created by @jdanbrown on GitHub (Dec 1, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

No idea if this is a model error or opencode error, but I figured I'd file it in case it indicates anything helpful for opencode folks. I had a handful of roundtrips with google/gemini-3-pro-preview, and then its output stopped showing any formatting, and eventually the model itself went into a brain-damage loop. 🤷

Image Image

Config

$ opencode debug config
{
  "$schema": "https://opencode.ai/config.json",
  "theme": "jdanbrown",
  "keybinds": {
    "leader": "ctrl+o",
    "app_exit": "ctrl+d,<leader>q",
    "editor_open": "<leader>e",
    "theme_list": "<leader>t",
    "sidebar_toggle": "<leader>b",
    "status_view": "<leader>s",
    "session_export": "<leader>x",
    "session_new": "<leader>n",
    "session_list": "<leader>l",
    "session_timeline": "<leader>g",
    "session_share": "none",
    "session_unshare": "none",
    "session_interrupt": "ctrl+c",
    "session_compact": "<leader>c",
    "messages_page_up": "pageup",
    "messages_page_down": "pagedown",
    "messages_half_page_up": "ctrl+alt+u",
    "messages_half_page_down": "ctrl+alt+d",
    "messages_first": "ctrl+alt+a",
    "messages_last": "ctrl+alt+e",
    "messages_copy": "<leader>y",
    "messages_undo": "<leader>u",
    "messages_redo": "<leader>r",
    "messages_toggle_conceal": "<leader>h",
    "model_list": "<leader>m,ctrl+j",
    "model_cycle_recent": "f2",
    "model_cycle_recent_reverse": "shift+f2",
    "command_list": "ctrl+_",
    "agent_list": "<leader>a",
    "agent_cycle": "tab",
    "agent_cycle_reverse": "shift+tab",
    "input_clear": "ctrl+c",
    "input_forward_delete": "ctrl+d",
    "input_paste": "ctrl+v",
    "input_submit": "return",
    "input_newline": "alt+enter,shift+enter,shift+return",
    "history_previous": "up,ctrl+p",
    "history_next": "down,ctrl+n",
    "session_child_cycle": "<leader>right",
    "session_child_cycle_reverse": "<leader>left",
    "terminal_suspend": "ctrl+z"
  },
  "tui": {
    "scroll_acceleration": {
      "enabled": true
    },
    "diff_style": "stacked"
  },
  "share": "manual",
  "autoupdate": false,
  "model": "openrouter/anthropic/claude-haiku-4.5",
  "small_model": "openrouter/google/gemini-2.5-flash",
  "provider": {
    "openrouter": {
      "models": {
        "anthropic/claude-sonnet-4.5@thinking-32k": {
          "id": "anthropic/claude-sonnet-4.5",
          "options": {
            "reasoning": {
              "effort": "high"
            }
          }
        }
      }
    }
  },
  "mcp": {
    "context7": {
      "type": "remote",
      "url": "https://mcp.context7.com/mcp",
      "headers": {
        "CONTEXT7_API_KEY": ...
      }
    }
  },
  "formatter": {
    "swiftformat": {
      "command": [
        "swiftformat",
        "$FILE"
      ],
      "extensions": [
        ".swift"
      ]
    }
  },
  "instructions": [],
  "permission": {
    "bash": "allow",
    "external_directory": "allow"
  },
  "agent": {},
  "mode": {},
  "plugin": [],
  "command": {},
  "username": "danb"
}

OpenCode version

1.0.126

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

macOS 15.5

Terminal

VS Code terminal

Originally created by @jdanbrown on GitHub (Dec 1, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description No idea if this is a model error or opencode error, but I figured I'd file it in case it indicates anything helpful for opencode folks. I had a handful of roundtrips with `google/gemini-3-pro-preview`, and then its output stopped showing any formatting, and eventually the model itself went into a brain-damage loop. 🤷 - https://opencode.ai/s/b7Ka03T9 <img width="935" height="1644" alt="Image" src="https://github.com/user-attachments/assets/1a02bff4-602b-4840-9502-000f4904fbc4" /> <img width="928" height="1142" alt="Image" src="https://github.com/user-attachments/assets/98a29b2b-b05f-427f-8e60-30d5a3f2fe07" /> ### Config ```sh $ opencode debug config { "$schema": "https://opencode.ai/config.json", "theme": "jdanbrown", "keybinds": { "leader": "ctrl+o", "app_exit": "ctrl+d,<leader>q", "editor_open": "<leader>e", "theme_list": "<leader>t", "sidebar_toggle": "<leader>b", "status_view": "<leader>s", "session_export": "<leader>x", "session_new": "<leader>n", "session_list": "<leader>l", "session_timeline": "<leader>g", "session_share": "none", "session_unshare": "none", "session_interrupt": "ctrl+c", "session_compact": "<leader>c", "messages_page_up": "pageup", "messages_page_down": "pagedown", "messages_half_page_up": "ctrl+alt+u", "messages_half_page_down": "ctrl+alt+d", "messages_first": "ctrl+alt+a", "messages_last": "ctrl+alt+e", "messages_copy": "<leader>y", "messages_undo": "<leader>u", "messages_redo": "<leader>r", "messages_toggle_conceal": "<leader>h", "model_list": "<leader>m,ctrl+j", "model_cycle_recent": "f2", "model_cycle_recent_reverse": "shift+f2", "command_list": "ctrl+_", "agent_list": "<leader>a", "agent_cycle": "tab", "agent_cycle_reverse": "shift+tab", "input_clear": "ctrl+c", "input_forward_delete": "ctrl+d", "input_paste": "ctrl+v", "input_submit": "return", "input_newline": "alt+enter,shift+enter,shift+return", "history_previous": "up,ctrl+p", "history_next": "down,ctrl+n", "session_child_cycle": "<leader>right", "session_child_cycle_reverse": "<leader>left", "terminal_suspend": "ctrl+z" }, "tui": { "scroll_acceleration": { "enabled": true }, "diff_style": "stacked" }, "share": "manual", "autoupdate": false, "model": "openrouter/anthropic/claude-haiku-4.5", "small_model": "openrouter/google/gemini-2.5-flash", "provider": { "openrouter": { "models": { "anthropic/claude-sonnet-4.5@thinking-32k": { "id": "anthropic/claude-sonnet-4.5", "options": { "reasoning": { "effort": "high" } } } } } }, "mcp": { "context7": { "type": "remote", "url": "https://mcp.context7.com/mcp", "headers": { "CONTEXT7_API_KEY": ... } } }, "formatter": { "swiftformat": { "command": [ "swiftformat", "$FILE" ], "extensions": [ ".swift" ] } }, "instructions": [], "permission": { "bash": "allow", "external_directory": "allow" }, "agent": {}, "mode": {}, "plugin": [], "command": {}, "username": "danb" } ``` ### OpenCode version 1.0.126 ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System macOS 15.5 ### Terminal VS Code terminal
yindo added the bug label 2026-02-16 17:39:16 -05:00
Author
Owner

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

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

  • #4953: openrouter/google/gemini-3-pro-preview stops responding
  • #4912: Lots of REDACTED with openrouter/google/gemini-3-pro-preview
  • #4632: Gemini 3 pro preview issues (plan mode and general behavioral issues)
  • #4346: Gemini models hang waiting endlessly

Feel free to ignore if this specific formatting/brain-damage loop issue is distinct from these.

@github-actions[bot] commented on GitHub (Dec 1, 2025): This issue might be a duplicate of or related to existing issues. Please check: - #4953: openrouter/google/gemini-3-pro-preview stops responding - #4912: Lots of REDACTED with openrouter/google/gemini-3-pro-preview - #4632: Gemini 3 pro preview issues (plan mode and general behavioral issues) - #4346: Gemini models hang waiting endlessly Feel free to ignore if this specific formatting/brain-damage loop issue is distinct from these.
Author
Owner

@Shinobu-Kazahana commented on GitHub (Dec 1, 2025):

experiencing the same, highly annoying

@Shinobu-Kazahana commented on GitHub (Dec 1, 2025): experiencing the same, highly annoying
Author
Owner

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

It looks like the model misbehaving, I mean maybe the openrouter people are having more problems/bugs gemini seems to be a constant issue over there.

Now if this isn't related to openrouter then we can try to make some prompts more "gemini friendly" but gemini models have always had looping problems

@rekram1-node commented on GitHub (Dec 1, 2025): It looks like the model misbehaving, I mean maybe the openrouter people are having more problems/bugs gemini seems to be a constant issue over there. Now if this isn't related to openrouter then we can try to make some prompts more "gemini friendly" but gemini models have always had looping problems
Author
Owner

@jdanbrown commented on GitHub (Dec 1, 2025):

Yeah, I wonder if the output formatting and looping are two separate problems. Surely the looping is (at least partially) a gemini model problem, but the output formatting I'm hoping is an opencode/openrouter tool bug that's fixable.

@jdanbrown commented on GitHub (Dec 1, 2025): Yeah, I wonder if the output formatting and looping are two separate problems. Surely the looping is (at least partially) a gemini model problem, but the output formatting I'm hoping is an opencode/~~openrouter~~ tool bug that's fixable.
Author
Owner

@jdanbrown commented on GitHub (Dec 1, 2025):

Oh wait! — this isn't openrouter's gemini, this is normal google gemini. My bad. 🤦

  • I've edited the title and description with openrouter/google/gemini-3-pro-previewgoogle/gemini-3-pro-preview
  • The screenshot is correct: Google Gemini 3 Pro Preview (not OpenRouter Gemini 3 Pro Preview)
  • The config is says haiku/flash, but that's spurious, since I set my models with shell aliases that aren't reflected in opencode debug config
@jdanbrown commented on GitHub (Dec 1, 2025): Oh wait! — this isn't openrouter's gemini, this is normal google gemini. My bad. 🤦 - I've edited the title and description with `openrouter/google/gemini-3-pro-preview` → `google/gemini-3-pro-preview` - The screenshot is correct: `Google Gemini 3 Pro Preview` (not `OpenRouter Gemini 3 Pro Preview`) - The config is says `haiku`/`flash`, but that's spurious, since I set my models with shell aliases that aren't reflected in `opencode debug config`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3236