Add Gemini 3 and 3.1 OpenRouter model entries#923
Conversation
Add Gemini 3 and 3.1 OpenRouter model mappings so users can choose Gemini 3/3.1 models from model presets. Do not enable them by default in activeApiModes to preserve existing starting model behavior.
Summary of ChangesHello @PeterDaveHello, 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 enhances the application's model selection capabilities by integrating Google's Gemini 3 and 3.1 series through the OpenRouter platform. It enables users to choose these advanced models from available presets, providing more diverse options without impacting the existing default API mode configurations. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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
|
📝 WalkthroughWalkthroughThis pull request adds three new OpenRouter Gemini 3 model variants to the application's configuration. The changes include adding the model identifiers to the API model keys array and creating corresponding mappings with their API paths and display labels. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||
There was a problem hiding this comment.
Code Review
The pull request adds model entries for Gemini 3 and 3.1 on OpenRouter. While this follows the repository's pattern of including speculative model versions, these specific models do not currently exist on the OpenRouter platform or in Google's official lineup. Using these entries will result in failed API requests (404 errors). Additionally, the placement of these models at the top of the OpenRouter selection list may push functional models out of immediate view.
There was a problem hiding this comment.
Pull request overview
This PR adds OpenRouter model mappings for three new Gemini models (3 Pro, 3 Flash, and 3.1 Pro) to enable users to select these models from the model presets dropdown. The changes maintain backward compatibility by not adding these models to the default active list.
Changes:
- Added three new Gemini model keys to the
openRouterApiModelKeysarray - Added corresponding model configuration entries in the
Modelsobject with OpenRouter API values and descriptions
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/config/index.mjs (1)
107-109: Consider grouping new Gemini 3 entries with the existing Gemini 2.5 entries for consistency.In
openRouterApiModelKeys, the three new keys are prepended before all Claude entries (line 110+), whileopenRouter_google_gemini_2_5_proandopenRouter_google_gemini_2_5_flashsit after the Claude block (lines 116–117). This splits the Google/Gemini entries across the array, while the correspondingModelsobject entries (lines 393–404) are correctly grouped with the other Gemini models.♻️ Suggested reordering to keep all Gemini keys adjacent
export const openRouterApiModelKeys = [ - 'openRouter_google_gemini_3_pro', - 'openRouter_google_gemini_3_flash', - 'openRouter_google_gemini_3_1_pro', 'openRouter_anthropic_claude_sonnet4', 'openRouter_anthropic_claude_sonnet4_5', 'openRouter_anthropic_claude_opus4_5', 'openRouter_anthropic_claude_opus4_6', 'openRouter_anthropic_claude_haiku4_5', 'openRouter_anthropic_claude_3_7_sonnet', + 'openRouter_google_gemini_3_pro', + 'openRouter_google_gemini_3_flash', + 'openRouter_google_gemini_3_1_pro', 'openRouter_google_gemini_2_5_pro', 'openRouter_google_gemini_2_5_flash', 'openRouter_openai_o3', 'openRouter_openai_gpt_4_1_mini', ]🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/config/index.mjs` around lines 107 - 109, The openRouterApiModelKeys array currently splits Google/Gemini entries by prepending 'openRouter_google_gemini_3_pro', 'openRouter_google_gemini_3_flash', and 'openRouter_google_gemini_3_1_pro' before the Claude entries; move these three keys so they sit adjacent to the existing Gemini entries (e.g., next to 'openRouter_google_gemini_2_5_pro' and 'openRouter_google_gemini_2_5_flash') to keep all Gemini keys contiguous and consistent with the Models object grouping.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/config/index.mjs`:
- Around line 107-109: The openRouterApiModelKeys array currently splits
Google/Gemini entries by prepending 'openRouter_google_gemini_3_pro',
'openRouter_google_gemini_3_flash', and 'openRouter_google_gemini_3_1_pro'
before the Claude entries; move these three keys so they sit adjacent to the
existing Gemini entries (e.g., next to 'openRouter_google_gemini_2_5_pro' and
'openRouter_google_gemini_2_5_flash') to keep all Gemini keys contiguous and
consistent with the Models object grouping.
|
Perfect |
User description
Add Gemini 3 and 3.1 OpenRouter model mappings so users can choose Gemini 3/3.1 models from model presets.
Do not enable them by default in activeApiModes to preserve existing starting model behavior.
PR Type
Enhancement
Description
Add three new Gemini 3/3.1 OpenRouter model entries
Include Gemini 3 Pro, Gemini 3 Flash, and Gemini 3.1 Pro variants
Enable users to select Gemini models from model presets
Preserve existing default behavior without enabling by default
Diagram Walkthrough
File Walkthrough
index.mjs
Add Gemini 3/3.1 OpenRouter model configurationssrc/config/index.mjs
openRouterApiModelKeysarrayModelsobject with OpenRouter APIvalues and descriptions
variants
Summary by CodeRabbit