Skip to content

fix(sse): mark gemini-3.5-flash as thinking-capable - #10450

Open
diegosouzapw wants to merge 1 commit into
release/v3.8.50from
fix/10286-gemini-flash-thinking
Open

fix(sse): mark gemini-3.5-flash as thinking-capable#10450
diegosouzapw wants to merge 1 commit into
release/v3.8.50from
fix/10286-gemini-flash-thinking

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

Closes #10286

Root cause

src/shared/constants/modelSpecs.ts declares the shared GEMINI_35_FLASH_MODEL_SPEC
constant with supportsThinking: false. The base "gemini-3.5-flash" entry spreads
that spec, so getResolvedModelCapabilities() reports the base Google AI Studio model
as thinking-incapable, which makes capabilityFor()
(src/lib/reasoningRouting/policy.ts) resolve to "unsupported" for any
reasoning_effort, and applyDecision() (src/sse/handlers/reasoningRouting.ts)
turns that into a pre-provider HTTP 400 — even though the base model supports
reasoning (it has an effort-tier alias gemini-3.5-flash-high, and the reporter
independently verified flipping the flag to true works end-to-end).

The same shared GEMINI_35_FLASH_MODEL_SPEC constant is also spread into several
Antigravity flash-tier aliases (gemini-3.5-flash-low, gemini-3.5-flash-extra-low,
gemini-3-flash-agent, gemini-3.6-flash-*), and those tier ids are documented as
rejecting client-supplied thinking params (the model id itself selects the reasoning
tier upstream). So the fix does not flip the shared constant — it sets
supportsThinking: true as an explicit override on the base "gemini-3.5-flash"
entry only, leaving GEMINI_35_FLASH_MODEL_SPEC and all the Antigravity tier aliases
unchanged (still false).

Fix

src/shared/constants/modelSpecs.ts: added supportsThinking: true override on the
base "gemini-3.5-flash" entry (after the ...GEMINI_35_FLASH_MODEL_SPEC spread).

Regression test

tests/unit/gemini-3-5-flash-thinking.test.ts — TDD, fails on unfixed code
(AssertionError: false !== true / decision.capability 'unsupported' vs
'supported'), passes after the fix:

✔ gemini-3.5-flash (AI Studio provider) resolves as thinking-capable
✔ reasoning_effort 'high' on gemini-3.5-flash is NOT rejected by routing policy

Asserts both:

  1. getResolvedModelCapabilities({provider:"gemini", model:"gemini-3.5-flash"}).supportsThinking === true
  2. reasoning-routing policy resolves reasoning_effort:"high" on gemini-3.5-flash to
    capability "supported" (not the pre-provider 400).

Gates run

  • npm run typecheck:core — exit 0
  • npx eslint --suppressions-location config/quality/eslint-suppressions.json <changed files> — clean
  • node scripts/check/check-file-size.mjs — no new violation on modelSpecs.ts
  • node scripts/check/check-complexity.mjs — OK (2456 violations, baseline 2774)
  • node scripts/check/check-cognitive-complexity.mjs — OK (1104 violations, baseline 1223)
  • node scripts/check/check-test-discovery.mjs — OK, new test file discovered
  • npm run test:unit — started full suite; 614/4565 test files completed with 0
    failures before the run stalled to near-zero throughput under severe 13-way
    parallel devbox contention (13 concurrent fan-out agents running the identical
    full suite on shared hardware — not specific to this change). No regression
    signal in the portion that ran. CI runs on isolated runners and is the
    authoritative full-suite gate for this PR.

⚠️ base-red inherited: #9985 — ESLint errors (2) from #10250

The base gemini-3.5-flash entry spread the shared GEMINI_35_FLASH_MODEL_SPEC
constant, which has supportsThinking:false because it is also spread into
several Antigravity flash-tier aliases that reject client-supplied thinking
params. That made the reasoning-routing policy resolve reasoning_effort as
"unsupported" for the base Google AI Studio model, producing a spurious
pre-provider HTTP 400 even though the model supports reasoning (it has an
effort-tier alias gemini-3.5-flash-high).

Set supportsThinking:true as an explicit override on the base
gemini-3.5-flash entry only, leaving the shared spec and the Antigravity
tier aliases unchanged.

Closes #10286
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.

[BUG][FIX INCLUDED] Gemini 3.5 Flash incorrectly marked with supportsThinking: false

2 participants