Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Dec 23, 2025

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/URLs
    • getDefaultModelIdForProvider(), getStaticModelsForProvider()
    • shouldUseGenericModelPicker() - Determines which providers use generic ModelPicker
  • webview-ui/src/components/settings/utils/__tests__/providerModelConfig.spec.ts - 20 unit tests

Modified Files

  • ModelPicker.tsx - Added new props: label, valueTransform, displayTransform, onModelChange; added new ModelIdKey types for Ollama, LMStudio, VSCodeLM
  • ApiOptions.tsx - Replaced Select-based generic picker with ModelPicker using shouldUseGenericModelPicker()
  • Ollama.tsx - Replaced VSCodeTextField + VSCodeRadioGroup with ModelPicker
  • LMStudio.tsx - Replaced text + radio with ModelPicker; added second ModelPicker for draft model
  • VSCodeLM.tsx - Replaced Select with ModelPicker using transform functions for vendor/family object
  • ApiOptions.provider-filtering.spec.tsx - Added Popover/Command component mocks

Implementation Details

  • Static providers (Anthropic, Bedrock, Gemini, etc.) now use ModelPicker via shouldUseGenericModelPicker()
  • VSCodeLM uses valueTransform/displayTransform to handle { vendor, family } object format
  • Bedrock's custom-arn option handled via getStaticModelsForProvider()
  • Error messages passed to ModelPicker via errorMessage prop

Test Results

All tests pass (356 test files, 4957 tests passed, 48 skipped).


Important

Standardizes model selection UI with a ModelPicker component across providers, enhancing consistency and user experience.

  • Behavior:
    • Replaces various model selection UIs with a unified ModelPicker component across all providers.
    • Introduces shouldUseGenericModelPicker() to determine providers using the generic picker.
    • Handles custom-arn option for Bedrock in ApiOptions.tsx.
  • Components:
    • Adds ModelPicker with new props: label, valueTransform, displayTransform, onModelChange.
    • Updates ApiOptions.tsx, Ollama.tsx, LMStudio.tsx, VSCodeLM.tsx to use ModelPicker.
  • Utilities:
    • Adds providerModelConfig.ts for provider configurations and utility functions.
    • Includes 20 unit tests in providerModelConfig.spec.ts to verify configurations and picker logic.

This description was created by Ellipsis for e0a24c8. You can customize this summary. It will automatically update as commits are pushed.

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. Enhancement New feature or request labels Dec 23, 2025
@roomote
Copy link
Contributor

roomote bot commented Dec 23, 2025

Oroocle Clock   See task on Roo Cloud

Re-review complete. No outstanding issues.

  • Fix Z.ai default model in generic ModelPicker flow when zaiApiLine is set to China entrypoint (default link should match getProviderDefaultModelId).
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Dec 23, 2025
@hannesrudolph hannesrudolph moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Dec 23, 2025
@hannesrudolph hannesrudolph moved this from PR [Needs Prelim Review] to PR [Needs Review] in Roo Code Roadmap Dec 23, 2025
@hannesrudolph hannesrudolph added PR - Needs Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Dec 23, 2025
@brunobergher
Copy link
Collaborator

LGTM

Comment on lines +771 to +762
// Clear custom ARN if not using custom ARN option (Bedrock)
if (modelId !== "custom-arn" && selectedProvider === "bedrock") {
setApiConfigurationField("awsCustomArn", "")
}
Copy link
Collaborator

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roomote fix this

Copy link
Contributor

@roomote roomote bot Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixaroo Clock   See task on Roo Cloud

Fixed the reported issue. All local checks passed.

View commit | Revert commit

@hannesrudolph
Copy link
Collaborator Author

@roomote do what @mrubens said in their reviews and/or comments!

@roomote
Copy link
Contributor

roomote bot commented Jan 8, 2026

Fixaroo Clock   See task on Roo Cloud

Verified the Z.ai default model fix is already properly implemented:

  • mainlandZAiDefaultModelId is imported correctly (line 33)
  • Generic ModelPicker correctly uses conditional logic for zaiApiLine (lines 756-762)
  • PROVIDER_MODEL_CONFIG also handles the China/International entrypoint correctly (lines 340-346)
  • All 26 related tests pass

No additional changes required - the review issue is already resolved.

hannesrudolph and others added 5 commits January 9, 2026 19:04
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.
@hannesrudolph hannesrudolph force-pushed the feat/standardize-model-selectors branch from 967fa3f to e0a24c8 Compare January 10, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request PR - Needs Review size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Status: PR [Needs Review]

Development

Successfully merging this pull request may close these issues.

5 participants