Skip to content

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

Closed

Description

@jdanbrown

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

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Dec 1, 2025
  2. github-actions commented on Dec 1, 2025

    @github-actions
    Contributor

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

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

  3. Shinobu-Kazahana commented on Dec 1, 2025

    @Shinobu-Kazahana

    experiencing the same, highly annoying

  4. rekram1-node commented on Dec 1, 2025

    @rekram1-node
    Contributor

    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

  5. removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Dec 1, 2025
  6. self-assigned this
    on Dec 1, 2025
  7. jdanbrown commented on Dec 1, 2025

    @jdanbrown
    ContributorAuthor

    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.

  8. jdanbrown commented on Dec 1, 2025

    @jdanbrown
    ContributorAuthor

    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
  9. changed the title [-]openrouter/google/gemini-3-pro-preview output formatting went off the rails[/-] [+]google/gemini-3-pro-preview output formatting went off the rails[/+] on Dec 1, 2025
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