Skip to content

fix(google): broaden _is_gemini_3_flash_model to cover all Gemini 3 Flash variants#6210

Open
balazssandor wants to merge 1 commit into
livekit:mainfrom
balazssandor:fix/gemini-3-flash-model-detection
Open

fix(google): broaden _is_gemini_3_flash_model to cover all Gemini 3 Flash variants#6210
balazssandor wants to merge 1 commit into
livekit:mainfrom
balazssandor:fix/gemini-3-flash-model-detection

Conversation

@balazssandor

Copy link
Copy Markdown

Summary

  • _is_gemini_3_flash_model previously checked for the substring "gemini-3-flash", which missed gemini-3.5-flash (dot notation)
  • New logic: m.startswith("gemini-3") and "flash" in m — covers both gemini-3-flash-preview and gemini-3.5-flash, while correctly excluding gemini-3-pro-preview
  • Also removes the redundant startswith branch that was a subset of the in check

Test plan

  • Confirm gemini-3.5-flash returns True
  • Confirm gemini-3-flash-preview returns True
  • Confirm gemini-3-pro-preview returns False
  • Confirm gemini-2.5-flash returns False

🤖 Generated with Claude Code

…lash variants

Previously only matched `gemini-3-flash` (exact substring), missing `gemini-3.5-flash`
which uses dot notation. Now matches any model starting with `gemini-3` that contains
`flash`, correctly covering gemini-3-flash-preview and gemini-3.5-flash.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@balazssandor balazssandor requested a review from a team as a code owner June 24, 2026 14:30

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Open in Devin Review

Comment on lines +50 to +51
m = model.lower()
return m.startswith("gemini-3") and "flash" in m

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 New code now matches "gemini-3.5-flash" as a Gemini 3 Flash model (behavioral change)

The old code checked "gemini-3-flash" in model.lower() which would NOT match "gemini-3.5-flash" (the ".5" breaks the substring). The new code m.startswith("gemini-3") and "flash" in m DOES match "gemini-3.5-flash" since it starts with "gemini-3" and contains "flash". This model is actively used in the codebase (see livekit-plugins/livekit-plugins-google/livekit/plugins/google/models.py:207 and examples/other/cartesia.py:62). Previously it would get thinking level "low"; now it gets "minimal". This is likely intentional given the commit message says "broaden to cover all Gemini 3 Flash variants" and gemini-3.5-flash IS a flash model, but the test file at tests/test_google_thought_signatures.py doesn't cover this case, so it's worth confirming this is the desired behavior.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@CLAassistant

CLAassistant commented Jun 24, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants