feat(core): support custom reasoning models by default#19227
feat(core): support custom reasoning models by default#19227NTaylorMullen merged 2 commits intomainfrom
Conversation
- Refactor model feature gating to use capability-based logic - Introduce supportsModernFeatures and isCustomModel to identify models that should be treated as modern by default - Update GeminiChat, PromptProvider, and CodebaseInvestigatorAgent to use the new logic - Simplify snippets.ts by assuming modern capabilities for modern models
Summary of ChangesHello @NTaylorMullen, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the flexibility of the system by shifting from explicit model-name-based feature gating to a more dynamic, capability-driven approach. This change allows the system to seamlessly integrate and leverage advanced features for custom or future reasoning models, improving extensibility and reducing the need for frequent updates when new models are introduced. The refactoring ensures that the system can intelligently adapt its behavior based on a model's inherent capabilities rather than its specific branding. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a well-thought-out refactoring to support custom reasoning models by default. By adding isCustomModel and supportsModernFeatures utility functions, the codebase moves from hardcoded model names to a more flexible capability-based feature gating. This change is consistently applied across agents, chat logic, and prompt providers. The simplification of snippets.ts to assume modern features, with PromptProvider selecting the appropriate snippet version, is a clean architectural choice. The accompanying tests for the new model logic are thorough. The changes look solid and effectively achieve the stated goal.
|
Size Change: -102 B (0%) Total Size: 24.4 MB ℹ️ View Unchanged
|
| return '\n- **Conflict Resolution:** Instructions are provided in hierarchical context tags: `<global_context>`, `<extension_context>`, and `<project_context>`. In case of contradictory instructions, follow this priority: `<project_context>` (highest) > `<extension_context>` > `<global_context>` (lowest).'; | ||
| } | ||
|
|
||
| function mandateExplainBeforeActing(isGemini3: boolean): string { |
There was a problem hiding this comment.
do we not need to check this anymore?
There was a problem hiding this comment.
Correct! This prompt is only called for Gemini 3 models and custom models anyways. Was legacy 😁
snippets.legacy.ts is used for 2.5 series
Summary
Refactor model feature gating to support custom/unknown reasoning models by default. Non-Gemini branded models are now treated as "modern" to enable features like thoughts and modern system prompts without hardcoding names.
Details
supportsModernFeaturesandisCustomModelto identify non-Gemini branded models.PromptProvider,GeminiChat, and agents to use capability-based checks instead of hardcoded model lists.snippets.tsby assuming modern capabilities when invoked.Related Issues
N/A
How to Validate
gemini --model custom-model "Hello"npm test -w @google/gemini-cli-core -- src/config/models.test.ts src/core/geminiChat.test.ts src/core/prompts.test.tsPre-Merge Checklist