-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: Hide static providers with no models from provider list #7392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add logic to filter out static providers that have no models after organization filtering - Always show currently selected provider to preserve existing configurations - Only apply filtering to static providers to avoid race conditions with dynamic providers - Add comprehensive test suite to verify behavior This improves the user experience by hiding providers that have no available models while maintaining backward compatibility for existing configurations.
| }) | ||
|
|
||
| it("should hide static providers with empty models", () => { | ||
| // Mock MODELS_BY_PROVIDER to have an empty provider |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests directly mutate global constants (MODELS_BY_PROVIDER and PROVIDERS) for setup/cleanup. Consider using beforeEach/afterEach or deep clones to avoid side effects and test order dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution! I've reviewed the changes and this is a well-implemented feature that successfully hides static providers with no models from the provider dropdown list.
Positive Aspects:
✅ Excellent backward compatibility - always shows the currently selected provider even if it has no models
✅ Smart distinction between static and dynamic providers
✅ Comprehensive test coverage with 6 well-structured test cases
✅ Clear code comments explaining the logic
✅ Proper handling of organization allow lists
I've left a few minor suggestions inline that could improve code organization and maintainability, but overall this implementation is solid and ready to merge. Great work on maintaining backward compatibility and providing comprehensive test coverage!
Description
This PR adds logic to hide static providers from the provider dropdown list when they have no models available, while preserving backward compatibility for existing user configurations.
Changes
MODELS_BY_PROVIDER) are now hidden from the provider list if they have no models after organization filteringImplementation Details
The filtering logic in
ApiOptions.tsx:MODELS_BY_PROVIDER)Testing
Added comprehensive test suite in
ApiOptions.provider-filtering.spec.tsxthat verifies:allowAll: trueare always shownAll tests pass successfully ✅
Impact
This improves the user experience by:
Fixes the issue where providers with no models would appear in the list but be unusable.
Important
Hides static providers without models from the provider list in
ApiOptions.tsx, ensuring dynamic providers and selected providers are always visible, with comprehensive tests added.ApiOptions.tsx, static providers without models are hidden from the dropdown list unless they are currently selected.ApiOptions.provider-filtering.spec.tsxto test provider visibility based on model availability and organization allow list.This description was created by
for eec762b. You can customize this summary. It will automatically update as commits are pushed.