Skip to content

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

Merged
diegosouzapw merged 1 commit into
release/v3.8.50from
fix/10286-gemini-flash-thinking
Aug 17, 2026
Merged

diegosouzapw merged 1 commit into
release/v3.8.50from
fix/10286-gemini-flash-thinking

Conversation

@diegosouzapw

Copy link
Copy Markdown
Collaborator

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
@diegosouzapw

Copy link
Copy Markdown
Collaborator Author

Reviewed PR #10450 against release/v3.8.50. No verified defects found. The override is correctly limited to the native gemini-3.5-flash MODEL_SPECS entry; GEMINI_35_FLASH_MODEL_SPEC remains false for Antigravity tier IDs, and gemini-web's explicit supportsReasoning:false remains authoritative. The regression test covers both resolved capability and reasoning-routing policy. I could not execute the test in a checkout with PR-head path aliases, so this is merge-ready with PLAUSIBLE confidence rather than a confirmed runtime result. Base-red #9985 is inherited and not attributed to this PR.

@diegosouzapw

Copy link
Copy Markdown
Collaborator Author

Validated in local merge-train /srv/omniroute-train/.claude/worktrees/merge-train-20260817-084218-suite.log on tomni-proxmox-113 @ 24d32c994a9dfb0b7019d9450428f2fba1ce73c5 (FAST gates green: static + changed tests + vitest; the daily full-suite gate remains required).

@diegosouzapw
diegosouzapw merged commit b17dfa4 into release/v3.8.50 Aug 17, 2026
32 of 34 checks passed
@diegosouzapw
diegosouzapw deleted the fix/10286-gemini-flash-thinking branch August 17, 2026 11:46
diegosouzapw pushed a commit that referenced this pull request Aug 24, 2026
…k the release PR

The living release PR #8875 was CONFLICTING, which makes GitHub skip EVERY
pull_request workflow silently (no ci.yml, no semgrep, no DAST). Back-merging
main restores a computable merge ref.

Strategy `-s ours`: main is a stale snapshot of the release line (PR #11088 was
merged into main from a release-tip base, dragging ~5094 files). All 7 main-only
commits were verified as already represented on this branch:

- #11088 ollama capability routing  -> ported here as #11271 (6d4c484)
- #11075 shared passthrough providers -> ported here as #11165 (92ef3c7)
- #10055 getModelsDevPricing memoization -> present (modelsDevSync.ts)
- #10026 hide health-check excluded models -> present and extended (catalog.ts)
- /_tasks anchored gitignore hardening -> present (.gitignore:288)
- nanoid/dompurify Dependabot bumps -> identical versions

main-only files intentionally NOT carried over:

- changelog.d/fixes/10286-gemini-3-5-flash-thinking.md + its regression test:
  the fix landed here as #10450 and was then deliberately superseded by
  2764812 "eliminate Gemini 3.5 Flash". The test fails on this branch by
  design.
- public/providers/hackclub.svg: provider removed here (migration 162).
- docs/superpowers/**/2026-08-23-qdrant-*: planning artifacts belong in _tasks/
  (AGENTS.md), never under docs/.
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…e#10450)

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 cheaper-inference#10286

Co-authored-by: adevwithpurpose <adevwithpurpose@users.noreply.github.com>
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…k the release PR

The living release PR cheaper-inference#8875 was CONFLICTING, which makes GitHub skip EVERY
pull_request workflow silently (no ci.yml, no semgrep, no DAST). Back-merging
main restores a computable merge ref.

Strategy `-s ours`: main is a stale snapshot of the release line (PR cheaper-inference#11088 was
merged into main from a release-tip base, dragging ~5094 files). All 7 main-only
commits were verified as already represented on this branch:

- cheaper-inference#11088 ollama capability routing  -> ported here as cheaper-inference#11271 (ec959d8)
- cheaper-inference#11075 shared passthrough providers -> ported here as cheaper-inference#11165 (4813c32)
- cheaper-inference#10055 getModelsDevPricing memoization -> present (modelsDevSync.ts)
- cheaper-inference#10026 hide health-check excluded models -> present and extended (catalog.ts)
- /_tasks anchored gitignore hardening -> present (.gitignore:288)
- nanoid/dompurify Dependabot bumps -> identical versions

main-only files intentionally NOT carried over:

- changelog.d/fixes/10286-gemini-3-5-flash-thinking.md + its regression test:
  the fix landed here as cheaper-inference#10450 and was then deliberately superseded by
  bc825a1 "eliminate Gemini 3.5 Flash". The test fails on this branch by
  design.
- public/providers/hackclub.svg: provider removed here (migration 162).
- docs/superpowers/**/2026-08-23-qdrant-*: planning artifacts belong in _tasks/
  (AGENTS.md), never under docs/.
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