Skip to content

Conversation

richieforeman
Copy link
Member

@richieforeman richieforeman commented Aug 4, 2025

TLDR

This allows model setting to be applied from settings.json, defaulting only to the DEFAULT_MODEL (Gemini 2.5 Pro) iff there is nothing in argv && merged settings.

Dive Deeper

I felt it made sense to have the --model flag always take priority over other values, since that's always invoked by the user on demand rather than a passive config file.

Reviewer Test Plan

  • If settings.json && --model are empty, then the default model should kick in
  • --model always wins over settings.json

Testing Matrix

🍏 🪟 🐧
npm run x x
npx
Docker x
Podman - -
Seatbelt x - -

Linked issues / bugs

@richieforeman richieforeman requested a review from a team as a code owner August 4, 2025 19:51
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @richieforeman, 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 configuration system by allowing the AI model to be specified in settings.json. It establishes a clear precedence: command-line arguments (--model) override settings.json settings, and if neither is present, a default model (gemini-2.5-pro) is used. This change provides greater flexibility for users to manage their preferred AI model.

Highlights

  • Flexible Model Configuration: I've enabled the model setting to be read from settings.json, giving users another way to configure their preferred AI model.
  • Model Precedence Logic: I've implemented a clear hierarchy for model selection: command-line arguments (--model) take priority, followed by the settings.json entry, and finally, a default model (gemini-2.5-pro) is used if no other model is specified.
  • Comprehensive Test Coverage: I've added new unit tests to config.test.ts to thoroughly validate the model selection logic, ensuring that settings.json settings, command-line arguments, and the default fallback all behave as expected.
Using Gemini Code Assist

The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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 or fill out our survey to provide feedback.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly implements the ability to set the model from settings.json, with a clear precedence order of CLI arguments, then settings, then a default. The new logic is well-tested. However, a debugger statement was left in the code, which is a critical issue that must be addressed before merging.

@jacob314 jacob314 self-requested a review August 4, 2025 20:18
Copy link
Collaborator

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -86,6 +86,8 @@ export interface Settings {
bugCommand?: BugCommandSettings;
checkpointing?: CheckpointingSettings;
autoConfigureMaxOldSpaceSize?: boolean;
/** The model name to use (e.g 'gemini-9.0-pro') */
Copy link
Collaborator

Choose a reason for hiding this comment

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

wow didn't realize 9.0 pro was out :)

@jacob314 jacob314 enabled auto-merge August 4, 2025 20:27
@jacob314 jacob314 added this pull request to the merge queue Aug 4, 2025
Merged via the queue into google-gemini:main with commit 11808ef Aug 4, 2025
23 of 26 checks passed
@richieforeman richieforeman deleted the rf/config branch August 4, 2025 20:54
thacio added a commit to thacio/auditaria that referenced this pull request Aug 5, 2025
eserlxl pushed a commit to eserlxl/gemini-cli that referenced this pull request Aug 5, 2025
@NGS-NEGUS
Copy link

TLDR

This allows model setting to be applied from settings.json, defaulting only to the DEFAULT_MODEL (Gemini 2.5 Pro) iff there is nothing in argv && merged settings.

Dive Deeper

I felt it made sense to have the --model flag always take priority over other values, since that's always invoked by the user on demand rather than a passive config file.

Reviewer Test Plan

  • If settings.json && --model are empty, then the default model should kick in
  • --model always wins over settings.json

Testing Matrix

🍏 🪟 🐧
npm run x x
npx
Docker x
Podman - -
Seatbelt x - -

Linked issues / bugs

JunYang-tes pushed a commit to JunYang-tes/gemini-cli.nvim that referenced this pull request Aug 9, 2025
JeongJaeSoon pushed a commit to JeongJaeSoon/gemini-cli that referenced this pull request Aug 21, 2025
Gosling-dude pushed a commit to Gosling-dude/gemini-cli that referenced this pull request Aug 23, 2025
involvex pushed a commit to involvex/gemini-cli that referenced this pull request Sep 11, 2025
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.

Hardcoded DEFAULT_GEMINI_MODEL overrides settings.json configuration
3 participants