feat(core): Plumbing for late resolution of model configs.
This is just the plumbing, in the follow-up this new key will be used to handle retry logic(see GeminiChat on this branch for how this will look.)
Summary of Changes
Hello @joshualitt, I'm Gemini Code Assist[^1]! 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 lays the groundwork for more advanced model configuration management by introducing the concept of 'late resolution' for model configs, particularly focusing on retry logic. It enables the system to apply different model parameters based on whether a request is a retry, and provides a flexible way for users to define custom overrides. These changes are foundational, with the explicit goal of supporting future retry mechanisms without altering core model invocation logic.
Highlights
-
New
isRetryFlag for Model Configurations: Introduced anisRetryboolean property toModelConfigKeyandModelConfigOverride.matchinterfaces, allowing model configurations to be specifically tailored for retry attempts. This enables different model parameters (e.g., higher temperature) to be applied when a request is being retried. -
Support for Custom Model Overrides: Added a new
customOverridesproperty toModelConfigServiceConfigand the CLI'ssettingsSchema.ts. This provides a mechanism for users to define their own model configuration overrides, which are merged with and applied after the built-in overrides. -
Enhanced Default Configuration Merging: The
Configclass now ensures that default model configuration overrides (DEFAULT_MODEL_CONFIGS.overrides) are properly merged into the active configuration, even if the user only specifies aliases. This mirrors the existing behavior for default aliases. -
Retry-Specific Default Override Added: A new default override has been added for the
chat-basemodel. WhenisRetryis true, this override sets thegenerateContentConfig.temperatureto 1, providing a more exploratory response during retry scenarios. -
New Golden File for Retry Configurations: A new golden file,
resolved-aliases-retry.golden.json, along with a corresponding test, has been added. This ensures the stability and correctness of resolved model configurations when theisRetryflag is active.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.
| 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 pull request 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 :thumbsup: and :thumbsdown: 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.
[^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.
Size Change: +941 B (0%)
Total Size: 21.5 MB
ℹ️ View Unchanged
| Filename | Size | Change |
|---|---|---|
./bundle/gemini.js |
21.5 MB | +941 B (0%) |
./bundle/sandbox-macos-permissive-closed.sb |
1.03 kB | 0 B |
./bundle/sandbox-macos-permissive-open.sb |
890 B | 0 B |
./bundle/sandbox-macos-permissive-proxied.sb |
1.31 kB | 0 B |
./bundle/sandbox-macos-restrictive-closed.sb |
3.29 kB | 0 B |
./bundle/sandbox-macos-restrictive-open.sb |
3.36 kB | 0 B |
./bundle/sandbox-macos-restrictive-proxied.sb |
3.56 kB | 0 B |