Skip to content

[pull] main from danny-avila:main - #208

Merged
pull[bot] merged 2 commits into
innFactory:mainfrom
danny-avila:main
Sep 2, 2026
Merged

[pull] main from danny-avila:main#208
pull[bot] merged 2 commits into
innFactory:mainfrom
danny-avila:main

Conversation

@pull

@pull pull Bot commented Sep 2, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

* 🔭 fix: Derive the Gemini prefill rule from the model version

`NO_PREFILL_GEMINI_MODELS` enumerated every Gemini model that rejects a
trailing `model`-role turn, so each new Flash release needed an SDK edit and
a publish before a downstream consumer could safely list the model. Gemini 3.8
Flash is the third model to hit this (after 3.6 and 3.7), and Google documents
the same restriction for it.

The Anthropic half of this SDK already derives the equivalent rule from the
model version — `modelDisallowsAssistantPrefill` parses the minor version and
compares it against 4.6 — which is why new Claude models need no change here.
This brings Google in line: every Flash release from 3.6 onward is matched by
version, so a future Flash model is covered on release.

The 3.5 generation is the one case a cutoff cannot express: Gemini 3.5
Flash-Lite rejects prefill while its sibling Gemini 3.5 Flash still accepts it,
so Flash-Lite stays an explicit entry and the list survives for exactly that
kind of exception.

Scoped to the Flash line deliberately. Dropping the turn silently degrades a
working prefill into a fresh generation, so a false positive is worse than a
false negative — the rule widens only where Google documents the restriction,
and Pro ids are left alone.

Tests pin the new coverage (3.8/3.9/3.10/4.0 Flash, prefixed and suffixed
ids), the preserved 3.5 split, and that the rule does not widen to Pro lines
or to near-miss ids like `gemini-3.7-flashy`.

Ref: https://ai.google.dev/gemini-api/docs/latest-model#api-changes-and-parameter-updates
Ref: https://ai.google.dev/gemini-api/docs/models/gemini-3.8-flash

* 🩹 fix: Match major-only Gemini Flash ids in the prefill cutoff

[Codex P2] The version pattern required a `.<minor>` component, but Google
ships Flash under both forms — `gemini-3.7-flash` and the major-only
`gemini-3-flash-preview`, which this repo already exercises in
`src/llm/vertexai/llm.spec.ts` and LibreChat lists by default.

So a future `gemini-4-flash` would not have matched, `rejectsModelTurnPrefill`
would have returned false, and the trailing model turn would have been sent —
the exact HTTP 400 the cutoff exists to prevent. Make the minor component
optional and read an omitted one as `.0`.

No behavior change for ids already covered: `gemini-3-flash-preview` reads as
3.0, below the 3.6 cutoff, so it keeps returning false as before.

`Number(match[2] || '0')` rather than a null check because TypeScript types an
optional capture group as `string`, so `!= null` trips
`@typescript-eslint/no-unnecessary-condition` even though an unmatched group is
`undefined` at runtime.
@pull pull Bot locked and limited conversation to collaborators Sep 2, 2026
@pull pull Bot added the ⤵️ pull label Sep 2, 2026
@pull
pull Bot merged commit 62d8cf1 into innFactory:main Sep 2, 2026
1 check passed
@pull
pull Bot deployed to publish September 2, 2026 22:45 Active
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant