Skip to content

fix(google): send thinkingLevel for any model with an effort ladder - #978

Open
DevMello wants to merge 1 commit into
lidge-jun:devfrom
DevMello:fix/gemini-reasoning-effort
Open

fix(google): send thinkingLevel for any model with an effort ladder#978
DevMello wants to merge 1 commit into
lidge-jun:devfrom
DevMello:fix/gemini-reasoning-effort

Conversation

@DevMello

@DevMello DevMello commented Aug 4, 2026

Copy link
Copy Markdown

Summary

  • Selecting a reasoning effort for gemini-3.1-pro-preview now actually sends generationConfig.thinkingConfig.thinkingLevel on the wire. The catalog has advertised low/medium/high for this model since the 3.6 rollout, but the adapter hardcoded thinking to gemini-3.5-flash and gemini-3.6-flash, so the picker choice was silently ignored.
  • The gate is now ladder driven: any model whose provider config advertises reasoning efforts (registry preset or user config) gets the mapped level. The old flash slice stays hardcoded so unladdered configs keep their current behavior.
  • Vertex participates only when a user explicitly configures a ladder. The seed google-vertex entry ships none, so the Vertex freeze documented in the 260722 rollout plan is preserved. Image models are excluded because thinkingConfig would suppress responseModalities.

Verification

  • bun test tests/google-hardening.test.ts tests/google-adapter.test.ts tests/google-antigravity-wire.test.ts tests/google-vertex-stream.test.ts (77 pass)
  • bun run typecheck, bun run lint:gui, bun run privacy:scan
  • bun test --isolate ./tests/ full suite green (7999 pass, 0 fail)
  • New tests: pro-preview ladder emits the level and clamps minimal to low, Vertex emits only with an explicit ladder, unladdered direct flash keeps its slice, image models keep responseModalities under a provider-wide ladder.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Summary by CodeRabbit

  • New Features
    • Google AI models now support configured reasoning levels where available.
    • Reasoning settings are automatically adjusted to each model’s supported capabilities.
    • Existing image-generation and fallback behavior remains supported.

@github-actions github-actions Bot added the bug Something isn't working label Aug 4, 2026
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a0e68511-b96c-48a2-bb53-6f0a22d2983a

📥 Commits

Reviewing files that changed from the base of the PR and between e3ba14f and 753ffdc.

📒 Files selected for processing (2)
  • src/adapters/google.ts
  • tests/google-hardening.test.ts

📝 Walkthrough

Walkthrough

The Google adapter now uses configured reasoning-effort ladders for eligible Gemini and Vertex models. Tests cover effort mapping, clamping, Vertex configuration, Flash fallback, and image-model exclusions.

Changes

Google reasoning request handling

Layer / File(s) Summary
Reasoning-aware request construction
src/adapters/google.ts
The adapter applies configured reasoning efforts to eligible Gemini and Vertex requests. It preserves direct Flash fallback behavior and excludes Cloud Code Assist and image-capable models.
Model-specific behavior validation
tests/google-hardening.test.ts
Tests cover Pro preview models, Vertex ladders, unsupported-effort clamping, direct Flash fallback, omitted thinking configuration, and image response modalities.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: ingwannu, wibias, lidge-jun

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: sending thinkingLevel for Google models with configured reasoning ladders.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant