Skip to content

fix(app): use the GA gemini-3.1-flash-lite slug#3504

Merged
tofikwest merged 1 commit into
mainfrom
fix/gemini-3-1-flash-lite-ga-slug
Jul 26, 2026
Merged

fix(app): use the GA gemini-3.1-flash-lite slug#3504
tofikwest merged 1 commit into
mainfrom
fix/gemini-3-1-flash-lite-ga-slug

Conversation

@tofikwest

@tofikwest tofikwest commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Companion to trycompai/comp-private#329, which carries the customer-facing fix.

Background

google/gemini-3.1-flash-lite-preview no longer exists — the AI Gateway retires -preview aliases when a model goes GA. Verified against the live catalog:

$ curl -s https://ai-gateway.vercel.sh/v1/models | grep gemini-3.1-flash-lite
google/gemini-3.1-flash-lite          ← exists (GA)
google/gemini-3.1-flash-lite-image
google/gemini-3.1-flash-lite-preview  ← GONE

Two paths in this repo referenced it.

1. Auto-link reranking — a real, silent regression

apps/app/src/lib/rerank-suggestions.ts calls the gateway directly for risk/vendor → task auto-link suggestions. Both callers in run-linkage.ts (rerankAndBuildScoreMap, rerankForAutonomousPersist) catch the failure and fall back to raw cosine similarity.

So nothing errored and nothing was logged to the user — auto-link suggestions have just been running at pre-reranker precision, which is the exact problem this module was added to solve (cosine scores collapse into a 0.61–0.64 band for short compliance prose, so on-target tasks and keyword coincidences rank identically).

Added a regression test asserting the requested slug is GA and not a -preview alias. Confirmed it fails against the old value:

× requests a GA model slug, never a -preview alias
  → expected 'google/gemini-3.1-flash-lite-preview' to be 'google/gemini-3.1-flash-lite'

2. Automation chat modelId — inert, updated for consistency

use-chat-handlers.ts (×3) and workflow-visualizer-simple.tsx (×1) send modelId in the request body, but the enterprise-api chat route hardcodes its own model and ignores the field. Updating them changes no behavior; it just stops the two repos disagreeing about which model is in use.

Verification

$ cd apps/app && npx vitest run src/lib/rerank-suggestions.spec.ts src/lib/embedding/run-linkage.spec.ts
 Test Files  2 passed (2)
      Tests  26 passed (26)

tsc --noEmit clean on all changed files; eslint clean.


Summary by cubic

Switch all references to the GA model google/gemini-3.1-flash-lite to fix silent reranking failures caused by the retired -preview alias. Also align inert chat modelId fields to the same GA slug for consistency.

  • Bug Fixes
    • Replace reranker model with google/gemini-3.1-flash-lite to stop 404s and restore auto-link suggestion quality.
    • Add a regression test that asserts a GA slug is used (no -preview), and update chat modelId fields to the GA slug (no behavior change).

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

Review in cubic

`google/gemini-3.1-flash-lite-preview` no longer exists: the AI Gateway
retires `-preview` aliases when a model goes GA. Two paths referenced it.

rerank-suggestions.ts calls the gateway directly for risk/vendor -> task
auto-link reranking. Both callers in run-linkage.ts catch the 404 and fall
back to raw cosine, so the breakage was silent — suggestions quietly
regressed to the pre-reranker precision this module exists to fix. Added a
regression test asserting the requested slug is GA, not a preview alias.

The automation chat `modelId` values are inert (the enterprise-api chat
route hardcodes its own model and ignores the body field), but they are
updated so the two repos do not disagree on which model is in use.
@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app Ready Ready Preview, Comment Jul 26, 2026 10:03pm
comp-framework-editor Ready Ready Preview, Comment Jul 26, 2026 10:03pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
portal Skipped Skipped Jul 26, 2026 10:03pm

Request Review

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@tofikwest
tofikwest merged commit ce4a59c into main Jul 26, 2026
11 checks passed
@tofikwest
tofikwest deleted the fix/gemini-3-1-flash-lite-ga-slug branch July 26, 2026 22:46
@claudfuen

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 3.108.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants