Skip to content

Bug: ChatGoogle treats gemini-3.5-flash as Gemini 2.5 and drops thinking_level #6063

Open

Description

@HardMax71

Browser Use Version

0.13.11 and main at c75e847 (same on 0.13.1)

Bug Description, Steps to Reproduce, Screenshots

ChatGoogle picks the thinking config by substring: only ids containing gemini-3-pro, gemini-3.1-pro, gemini-3-flash or gemini-3.1-flash get the Gemini 3 branches (chat.py#L291-L292). gemini-3.5-flash matches none of them and falls into the "Gemini 2.5 and earlier" branch (#L327-L338), so:

  • a thinking_level the caller sets is dropped, with the warning thinking_level="low" is not supported for this model, although Gemini 3.5 Flash supports minimal, low, medium and high;
  • with nothing set it sends no thinking config at all, while gemini-3-flash-preview gets the Gemini 3 Flash default thinking_budget=-1.

The repro below is offline: a stub client records the config instead of calling the API.

Failing Python Code

import asyncio
from types import SimpleNamespace

from google.genai import types

from browser_use.llm.google.chat import ChatGoogle
from browser_use.llm.messages import UserMessage


class FakeModels:
	"""Records the config ChatGoogle sends instead of calling the API."""

	async def generate_content(self, *, model, contents, config):
		self.config = config
		return types.GenerateContentResponse(
			candidates=[types.Candidate(content=types.Content(role='model', parts=[types.Part(text='ok')]), finish_reason='STOP')]
		)


async def show(model, **kwargs):
	fake = FakeModels()
	llm = ChatGoogle(model=model, api_key='unused', **kwargs)
	llm.get_client = lambda: SimpleNamespace(aio=SimpleNamespace(models=fake))
	await llm.ainvoke([UserMessage(content='hi')])
	print(f'{model} {kwargs} -> thinking_config={fake.config.get("thinking_config")}')


async def main():
	await show('gemini-3-flash-preview', thinking_level='low')
	await show('gemini-3.5-flash', thinking_level='low')
	await show('gemini-3.5-flash')


asyncio.run(main())

Output on main:

WARNING  [5-flash] thinking_level="low" is not supported for this model. Use thinking_budget instead (0 to disable, -1 for dynamic, or token count).
gemini-3-flash-preview {'thinking_level': 'low'} -> thinking_config={'thinking_level': <ThinkingLevel.LOW: 'LOW'>}
gemini-3.5-flash {'thinking_level': 'low'} -> thinking_config=None
gemini-3.5-flash {} -> thinking_config=None

LLM Model

gemini-3.5-flash

Operating System & Browser Versions

macOS, not browser related

Full DEBUG Log Output

The warning above is the only log line.

Matching gemini-3 with an optional minor version (gemini-3(\.\d+)?-flash, same for -pro) fixes it. I have that with tests and will open a PR.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions