Skip to content

Add current-generation Gemini models to AIModel and deprecate the 2.x members - #366

Merged
KrisBraun merged 1 commit into
mainfrom
twister-gemini-model-refresh
Aug 3, 2026
Merged

Add current-generation Gemini models to AIModel and deprecate the 2.x members#366
KrisBraun merged 1 commit into
mainfrom
twister-gemini-model-refresh

Conversation

@KrisBraun

Copy link
Copy Markdown
Contributor

Google has withdrawn most of the Gemini 2.x generation. Calling one of those
models now returns 404 "no longer available to new users", which affected the
AI tool in two ways:

  • A hint naming a withdrawn model failed the whole ai.prompt() call.
  • Several of the speed/cost tiers that resolve without a hint pointed at
    withdrawn models, so { speed: "capable", cost: "high" } and neighbouring
    tiers stopped working even for twists that never named a model.

Worth knowing if you are checking your own pins: the model-listing endpoints are
not sufficient evidence here. gemini-2.5-pro is still returned by ListModels,
and still advertises generateContent in supportedGenerationMethods, while an
actual generation request 404s. Only a real call distinguishes the two.

Changes

AddedAIModel.GEMINI_31_PRO, AIModel.GEMINI_35_FLASH, and
AIModel.GEMINI_35_FLASH_LITE.

Deprecated — the GEMINI_25_* and GEMINI_20_* members. They are kept, not
removed, so twists built against an earlier SDK version still compile. A hint
naming a withdrawn model is now served by its current equivalent rather than
erroring.

GEMINI_25_FLASH is deprecated but deliberately not remapped: it still
works, and silently substituting a model an author explicitly asked for would be
worse than letting it run until it is actually withdrawn.

The tiers that ai.prompt() resolves without a hint have also moved onto current
models, so every speed/cost combination works again.

Compatibility

Additive. No member is removed or renamed, and no existing twist needs a change
to keep working — deprecated members still compile and now resolve to a live
model. New code should name a 3.x member.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y9GNwKEBkEAoLYzkTngfGk

… members
Google has withdrawn most of the Gemini 2.x generation. A `hint` naming one of
those models made `ai.prompt()` fail outright, and the speed/cost tiers that
resolve without a hint pointed at several of them too, so `{ speed: "capable",
cost: "high" }` and neighbouring tiers stopped working.
Adds `GEMINI_31_PRO`, `GEMINI_35_FLASH`, and `GEMINI_35_FLASH_LITE`, and marks
the `GEMINI_25_*` and `GEMINI_20_*` members deprecated. The deprecated members
are kept so twists built against an earlier SDK version still compile, and a
hint naming a withdrawn model is now served by its current equivalent instead
of erroring.
`GEMINI_25_FLASH` is deprecated but not remapped: it still works, and silently
substituting a model an author deliberately asked for would be worse than
letting it run until it is actually withdrawn.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y9GNwKEBkEAoLYzkTngfGk
@KrisBraun
KrisBraun merged commit b3f4ff1 into mainAug 3, 2026
1 check passed
@KrisBraun
KrisBraun deleted the twister-gemini-model-refresh branch August 3, 2026 16:53
Sign up for freeto 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

@KrisBraun