Add model field for custom TOML command override#24930
Add model field for custom TOML command override#24930mrinank1301 wants to merge 5 commits intogoogle-gemini:mainfrom
Conversation
Summary of ChangesHello, 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 introduces the ability to specify a preferred Gemini model within custom TOML command definitions. This feature is designed to optimize quota usage by allowing lightweight commands to run on smaller models while preserving pro-model capacity for complex tasks. The implementation ensures that these model overrides are scoped strictly to the command execution, with the system automatically restoring the user's previous model configuration upon completion. Additionally, the PR includes stability improvements for Windows environments, specifically addressing file locking issues during cleanup and improving linter compatibility. Highlights
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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a model override feature, allowing users to specify a Gemini model in TOML command definitions. It updates the CLI to handle this override during execution and restores the original model upon completion. Additionally, it improves the clean script to handle locked files on Windows and updates the lint script to gracefully skip linters that are not supported on certain platforms. However, the changes to scripts/lint.js introduce critical syntax errors due to improperly closed template literals and unreachable code, which will cause the script to fail.
Summary
Add an optional model field to custom command .toml files, allowing users to pin a specific Gemini model per command. The override is temporary — the previously selected model is automatically restored after the response completes. This lets users save pro-model quota on verbose/lightweight commands like code recaps or documentation generation.
Details
Data flow:
Files changed:
Related Issues
Related to #19875
How to Validate
npx vitest run packages/cli/src/services/FileCommandLoader.test.ts
npx vitest run packages/cli/src/nonInteractiveCli.test.ts
Pre-Merge Checklist