google/gemini-3-pro-preview output formatting went off the rails
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
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
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.
experiencing the same, highly annoying
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
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.
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(notOpenRouter 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 inopencode debug config