Skip to content

feat: add Gemini 3.1 Flash Lite model#9

Open
iceteaSA wants to merge 3 commits into
cortexkit:mainfrom
iceteaSA:feat/gemini-flash-lite
Open

feat: add Gemini 3.1 Flash Lite model#9
iceteaSA wants to merge 3 commits into
cortexkit:mainfrom
iceteaSA:feat/gemini-flash-lite

Conversation

@iceteaSA

@iceteaSA iceteaSA commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Adds gemini-3.1-flash-lite — the newest Flash Lite the Antigravity API serves.

Verified against the live API

fetchAvailableModels lists it, and a real streamGenerateContent returns HTTP 200 echoing modelVersion: "gemini-3.1-flash-lite" — it's a working model, not a placeholder. Metadata from the API: 1,048,576 context / 65,535 max output, API_PROVIDER_GOOGLE_GEMINI, non-thinking text model. (The API serves no 3.5/3.6 Flash Lite yet; 3.1 is the current Lite.)

Changes

Mirrors the existing gemini-3.6-flash wiring (commit a8e4e28) for a lite text model:

  • model-registry.ts — model definition, gemini flash quota group, id list
  • transform/model-resolver.ts — resolves as non-thinking (isThinkingModel: false), excluded from the tier-suffix header path
  • plugin/request.ts — 65,535 max output tokens
  • config + Pi catalog — selectable as google/antigravity-gemini-3.1-flash-lite; exposed in the Pi provider

No thinking-tier or image handling (not applicable to a lite text model).

Verification

unit       1832 pass, 0 fail (+5 new)
e2e        28 pass, 0 fail
typecheck  clean
lint       clean, 0 warnings

Note: branched off current main, so the model lands in the pre-existing gemini flash quota group. If #8 (the two-pool quota rework) merges first, this collapses into the single gemini pool on rebase — a one-line classification adjustment.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Adds gemini-3.1-flash-lite as a text-only, non-thinking model (1,048,576 context / 65,535 max output). Fully wired across the opencode stack; resolves correctly on Antigravity and gemini-cli without tiers or preview, and is verified against the live API.

  • New Features

    • Registered antigravity-gemini-3.1-flash-lite with text-only limits; added to Antigravity model IDs and the gemini-flash quota group.
    • Resolver maps to gemini-3.1-flash-lite as non-thinking on Antigravity and gemini-cli, skipping -preview.
    • Request builder sets maxOutputTokens to 65,535 with no thinkingConfig.
    • Exposed as google/antigravity-gemini-3.1-flash-lite in the pi provider; pi now derives input modalities from the registry to keep Flash Lite text-only.
  • Bug Fixes

    • Drops any thinkingLevel/tier fields for Flash Lite on all paths, even when a tier suffix is present.

Written for commit 7115635. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 10 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/core/src/model-registry.ts
Comment thread packages/core/src/transform/model-resolver.ts
@iceteaSA

Copy link
Copy Markdown
Contributor Author

Both valid — fixed in 726e690.

  • Pi image input: the Pi catalog was hardcoding ['text', 'image'] for every model. It now derives input modalities from the registry's modalities.input, so flash-lite (and any future text-only model) exposes input: ['text'].
  • gemini-CLI thinking classification: the CLI header path was appending the -preview suffix (no CLI preview variant exists for flash-lite) and the generic gemini-3 logic then enabled thinking. The CLI path now passes the plain gemini-3.1-flash-lite id through and the non-thinking special case applies on both quota paths.

Tests added for both (input: ['text'] assertion; non-thinking resolution on the gemini-cli path). 1833/0 unit, 28/0 e2e.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/core/src/transform/model-resolver.ts
iceteaSA pushed a commit to iceteaSA/antigravity-auth that referenced this pull request Jul 24, 2026
…tches

P2 cortexkit#7: fetchQuotaSummary used only options.endpoints[0] for every
project attempt, so a 5xx on the primary endpoint permanently lost
the request. Iterate the endpoint list per project attempt so a 500
or 429 on one endpoint falls through to the next — matches the
legacy fetchers' failover convention.

P2 cortexkit#8: aggregateQuotaSummary derived the pool from group.buckets[0]
unconditionally, silently dropping the whole group when an
unrecognized bucketId led the array. Use the first RECOGNIZED
bucket for pool derivation so the recognized windows are kept.

P2 cortexkit#9: modelCount parsed the raw description prose and counted
non-comma / non-colon tokens, so the 'Models within this group:'
prefix was counted as a model. Strip the prefix before splitting.

P2 cortexkit#10: the windowed summary fetch and the gemini-CLI quota fetch
ran sequentially — two 10s timeouts back-to-back, ~20s per account
on modal open. Run them concurrently via Promise.all.
@iceteaSA

Copy link
Copy Markdown
Contributor Author

Valid — fixed in 7115635.

The leak was specific to the gemini-CLI path: that branch spread requestedTier onto thinkingLevel/tier unconditionally after resolving, so a tier-suffixed flash-lite request came back non-thinking but still carrying tier fields. It now returns before that spread for flash-lite.

Worth noting for the record: the antigravity path and resolveModelWithTier itself were already correct (the latter early-returns for flash-lite before any tier handling), so the leak was one path, not all of them. Tests cover all three anyway as regression guards — the gemini-CLI one fails on the pre-fix code (Received: "high").

1836/0 unit, 28/0 e2e, gates clean.

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.

1 participant