feat(core): add modelAvailabilityService for managing and tracking model health#13426
feat(core): add modelAvailabilityService for managing and tracking model health#13426adamfweidman merged 3 commits intomainfrom
Conversation
Summary of ChangesHello @adamfweidman, 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 implements a new service designed to enhance the robustness of model selection by providing a structured way to manage and query the health of various models. It distinguishes between different types of model failures, allowing the system to intelligently prioritize and select available models, thereby improving overall system resilience and user experience. 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. 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 introduces a ModelAvailabilityService to manage model health and availability, which is a great addition for robust model selection. The implementation is solid and includes good test coverage. I've identified one area for improvement in selectFirstAvailable where refactoring to remove duplicated logic would enhance maintainability. Overall, this is a well-executed feature.
|
Size Change: -2 B (0%) Total Size: 21.1 MB ℹ️ View Unchanged
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a ModelAvailabilityService to track model health and availability, which is a great addition for robust model selection. My review focuses on improving the correctness and maintainability of this new service. I've identified a critical issue where a terminal failure state could be incorrectly overridden by a transient one, and I've also suggested a refactoring to reduce code duplication and improve maintainability in the model selection logic. Overall, the changes are good and with these adjustments, the service will be more robust.
0825810 to
7ab0f74
Compare
… managing and tracking model health (google-gemini#13426)
Summary
Introduces
ModelAvailabilityServiceto track and manage the availability state of modelsDetails
ModelAvailabilityService: A centralized service to store and query model health.quotaorcapacitythat render a model unusable for the current session (or until cleared).selectFirstAvailablemethod iterates through a priority list of models and picks the first one that satisfies availability constraints, returning skipped reasons for others.Related Issues
Fixes: https://github.com/google-gemini/maintainers-gemini-cli/issues/1072
How to Validate
npm run test
Pre-Merge Checklist