-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat: standardize model selectors across all providers #10294
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
base: main
Are you sure you want to change the base?
Conversation
Re-review complete. No outstanding issues.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
|
LGTM |
| // Clear custom ARN if not using custom ARN option (Bedrock) | ||
| if (modelId !== "custom-arn" && selectedProvider === "bedrock") { | ||
| setApiConfigurationField("awsCustomArn", "") | ||
| } |
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.
Same comment here (I know this was there before) - smells like a more general problem where we're not clearing out data correctly on model changes.
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.
@roomote fix this
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.
Fixaroo
See task on Roo Cloud
Fixed the reported issue. All local checks passed.
Verified the Z.ai default model fix is already properly implemented:
No additional changes required - the review issue is already resolved. |
Replace various model selection UI patterns with consistent ModelPicker component: - Replace Select dropdowns for static providers (Anthropic, Bedrock, etc.) - Replace text input + radio buttons for Ollama and LM Studio - Replace Select for VSCodeLM with transform functions for vendor/family object - Add providerModelConfig.ts with service configuration helpers - Add unit tests for new utility functions
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
…delConfig Move provider-specific Z.ai default model ID logic from ApiOptions.tsx template into getDefaultModelIdForProvider() utility function. This keeps the ApiOptions component provider-agnostic and centralizes the logic for handling China vs International entrypoints.
967fa3f to
e0a24c8
Compare
Summary
Replaces various model selection UI patterns with a consistent search-style ModelPicker component across all providers, giving users a unified experience as outlined in
plans/standardize-model-selector.md.Changes
New Files
webview-ui/src/components/settings/utils/providerModelConfig.ts- Helper utilities including:PROVIDER_SERVICE_CONFIG- Maps providers to service names/URLsgetDefaultModelIdForProvider(),getStaticModelsForProvider()shouldUseGenericModelPicker()- Determines which providers use generic ModelPickerwebview-ui/src/components/settings/utils/__tests__/providerModelConfig.spec.ts- 20 unit testsModified Files
ModelPicker.tsx- Added new props:label,valueTransform,displayTransform,onModelChange; added new ModelIdKey types for Ollama, LMStudio, VSCodeLMApiOptions.tsx- Replaced Select-based generic picker with ModelPicker usingshouldUseGenericModelPicker()Ollama.tsx- Replaced VSCodeTextField + VSCodeRadioGroup with ModelPickerLMStudio.tsx- Replaced text + radio with ModelPicker; added second ModelPicker for draft modelVSCodeLM.tsx- Replaced Select with ModelPicker using transform functions for vendor/family objectApiOptions.provider-filtering.spec.tsx- Added Popover/Command component mocksImplementation Details
ModelPickerviashouldUseGenericModelPicker()valueTransform/displayTransformto handle{ vendor, family }object formatgetStaticModelsForProvider()errorMessagepropTest Results
All tests pass (356 test files, 4957 tests passed, 48 skipped).
Important
Standardizes model selection UI with a
ModelPickercomponent across providers, enhancing consistency and user experience.ModelPickercomponent across all providers.shouldUseGenericModelPicker()to determine providers using the generic picker.ApiOptions.tsx.ModelPickerwith new props:label,valueTransform,displayTransform,onModelChange.ApiOptions.tsx,Ollama.tsx,LMStudio.tsx,VSCodeLM.tsxto useModelPicker.providerModelConfig.tsfor provider configurations and utility functions.providerModelConfig.spec.tsto verify configurations and picker logic.This description was created by
for e0a24c8. You can customize this summary. It will automatically update as commits are pushed.