Skip to content

fix(core): build Gemma 4 thinking variants on Interactions - #65038

Merged
rekram1-node merged 1 commit into
devfrom
gemma-interactions-variants
Nov 20, 2026
Merged

rekram1-node merged 1 commit into
devfrom
gemma-interactions-variants

Conversation

@rekram1-node

Copy link
Copy Markdown
Member

Issue for this PR

No linked issue.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

I added the same toggle variants that GenerateContent shows for Gemma 4. On Interactions, I use the catalog's toggle-only support to choose these variants. Gemini 2.5 budget models keep their existing behavior.

 Gemma 4 on Interactions
- no thinking variants
+ none     → thinking_level: minimal
+ thinking → thinking_level: high

How did you verify your code works?

I sent the same short arithmetic prompt at each thinking level to Google's live Interactions API. Successful requests show thought token counts; rejected requests show HTTP 400.

Model minimal low medium high xhigh
gemma-4-31b-it 0 tokens HTTP 400 HTTP 400 165 tokens HTTP 400
gemma-4-26b-a4b-it 0 tokens HTTP 400 HTTP 400 197 tokens HTTP 400

I also verified that both models complete with high and automatic thinking summaries. The regression test checks both toggle variants and confirms a model with a toggle and a budget still gets no variants. All 76 affected core tests passed, along with core bun typecheck and root bun run check.

Screenshots / recordings

Not applicable.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@opencodejr opencodejr 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.

Looks good. I compared variant resolution on the base and on this branch. On the base, the new test fails: a toggle-only model on Google Interactions gets no variants. With the PR, it gets none (thinkingLevel: minimal) and thinking (thinkingLevel: high, summaries auto). Models with effort or budget support still get the same variants as before. The Interactions protocol accepts both levels. Core tests and tsc -b pass. I couldn't call the live API here, so the per-level results against Google come from your table.

The public API is unchanged; only the internal Protocol signature in variant.ts changed.

@rekram1-node
rekram1-node enabled auto-merge (squash) November 20, 2026 01:43
@rekram1-node
rekram1-node merged commit 9d754e3 into dev Nov 20, 2026
11 checks passed
@rekram1-node
rekram1-node deleted the gemma-interactions-variants branch November 20, 2026 01:46
@amrkmn amrkmn mentioned this pull request Nov 23, 2026
1 task
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.

1 participant