Conversation
* ensure onModelChange is same model is selected once with persistence flag off and immediately again with persistence flag on TEST=config.test.ts new case added and also manual
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 addresses a bug where the model persistence mechanism failed to correctly save a model if it was first set temporarily and then subsequently marked for persistence without a change in the model's value. The fix ensures that the 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 correctly addresses a bug where model persistence was not triggered when selecting the same model again with the 'Remember' option enabled. The fix properly decouples the persistence logic (onModelChange) from the internal state update logic, ensuring that the persistence callback is always invoked when a model selection is not temporary. The addition of a specific test case for this scenario in config.test.ts is excellent and ensures this behavior is covered against future regressions. The changes are logical and well-implemented.
|
Size Change: -8 B (0%) Total Size: 25.9 MB ℹ️ View Unchanged
|
Summary
TEST=config.test.ts new case added and also manual
Details
In
config.tssetModel function, the check if (this.model !== newModel || this._activeModel !== newModel) wrapped both the state update and the persistence logic (this.onModelChange). Since selecting the identical manual model string meant the state didn't change, the logic bypassed persistence saving when toggling from "Remember: false" to "Remember: true".Moved the this.onModelChange call to the outer level so that it always executes if
!isTemporaryis true, ensuring that even if the active model didn't change visually, the persistence logic is applied securely.Related Issues
Fixes #19864
How to Validate
/modelPre-Merge Checklist