fix(create): replace retired gemini-2.0-flash-exp in AI chat templates #562
main fromrefs/pull/562/head·merged by tannerlinsley The generated AI chat routes for React still call gemini-2.0-flash-exp, which Google has shut down, so choosing Gemini in a generated project fails at the first request.
Cause#
The React AI add-on (api.ai.chat.ts) and the resume and events examples (api.resume-chat.ts, api.remy-chat.ts) set model = 'gemini-2.0-flash-exp' for the Gemini provider and use it as the fallback. Google retired the gemini-2.0-flash family on 2026-06-01.
Fix#
Use gemini-3.8-flash, the current stable Flash model on the Gemini API, in those three routes (both the explicit assignment and the fallback). A patch changeset is included.
Test#
Extended packages/create/tests/template-model-ids.test.ts with a check that no framework template references gemini-2.0-flash. It fails on main (listing the three files) and passes with this change; the other tests in the file still pass. No live API calls were made.
This change was prepared with the help of an AI coding assistant (Claude); the submitter is responsible for it.
Summary by CodeRabbit#
- Updates
- Generated AI chat examples now use Gemini 3.8 Flash instead of the retired Gemini 2.0 Flash Experimental model.
- Tests
- Added a check to catch retired Gemini model IDs in generated templates.
- 1
No actionable comments were generated in the recent review.
Walkthrough
-
Three generated React chat routes now use
gemini-3.8-flashinstead ofgemini-2.0-flash-exp. The template model-ID test scans for retired Gemini IDs.Changes: Gemini model updates
Layer / File(s) Summary Update generated chat models
packages/create/src/frameworks/react/add-ons/ai/assets/src/routes/demo/api.ai.chat.ts,packages/create/src/frameworks/react/examples/events/assets/src/routes/api.remy-chat.ts,packages/create/src/frameworks/react/examples/resume/assets/src/routes/api.resume-chat.ts,.changeset/gemini-current-model.mdThe three generated chat routes use gemini-3.8-flashfor Gemini model selection and fallback. The changeset records the model update.Check templates for retired Gemini IDs
packages/create/tests/template-model-ids.test.tsThe template scan helper accepts an optional regular-expression pattern. A test checks framework templates for retired Gemini model IDs. Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
- TanStack/cli#535: Introduced template scanning for retired model IDs, which this change extends to Gemini IDs.
- TanStack/cli#543: Replaced a retired Claude model and added scanning that this change extends to the Gemini model family.
Suggested reviewers:
tannerlinsley
Merge Risk:
Minimal · up to6ed8a-
The template model updates and retired-ID test changes are ready to merge.
Pre-merge checks:
4 · 1-
Failed checks: 1 warningCheck name Status Explanation Resolution Docstring Coverage Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold. Passed checks: 4 passed-
Check name Status Explanation Description Check Check skipped - CodeRabbit’s high-level summary is enabled. Title check The title names the primary change: replacing the retired gemini-2.0-flash-exp model in the AI chat templates. The raw summary confirms the changeset updates the AI add-on and the resume and events ex… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Full details: Title check
-
Explanation
The title names the primary change: replacing the retired gemini-2.0-flash-exp model in the AI chat templates. The raw summary confirms the changeset updates the AI add-on and the resume and events example routes to gemini-3.8-flash, and that the template test was extended to detect retired Gemini 2.0 Flash IDs. The title is specific and matches the changeset. It uses the conventional commit prefix and stays under one line.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 4 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
ESLint-
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
packages/create/tests/template-model-ids.test.ts
-
Parsing error: "parserOptions.project" has been provided for
@typescript-eslint/parser. The file was not found in any of the provided project(s): packages/create/tests/template-model-ids.test.ts
-
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
4747f62f-5656-4651-a4db-8cb14297a65f
Commits-
Reviewing files that changed from the base of the PR and between b42d225b0070a91bcde79eaec4a59e31b37f889c and 6ed8aba0d349013c1116c6d325c7b54876188c59.
Files selected for processing: 5-
.changeset/gemini-current-model.mdpackages/create/src/frameworks/react/add-ons/ai/assets/src/routes/demo/api.ai.chat.tspackages/create/src/frameworks/react/examples/events/assets/src/routes/api.remy-chat.tspackages/create/src/frameworks/react/examples/resume/assets/src/routes/api.resume-chat.tspackages/create/tests/template-model-ids.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
-
-
tannerlinsley merged this6d6116b
tannerlinsley closed this
Sign in to join this conversation.
🦋 Changeset detected#
Latest commit: 6ed8aba0d349013c1116c6d325c7b54876188c59
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR