Description
With the LiteLLM provider, the model ID on the settings screen cannot be changed: after picking a model (e.g. via "Use custom model..."), the picker silently reverts to the hardcoded default (claude-3-7-sonnet-20250219). The user's selection is not displayed afterwards, so the setting appears broken.
Steps to reproduce
- Open Settings → Providers → LiteLLM.
- Set the base URL and API key, then refresh the model list.
- Pick a model ID that is not present in the fetched
/models list (e.g. a custom alias) via "Use custom model...".
- The picker immediately reverts to the default model ID.
- Save, close and reopen Settings — the configured model ID is not shown; the default is shown instead.
Root cause
The LiteLLM case in webview-ui/src/components/ui/hooks/useSelectedModel.ts validates the configured litellmModelId against the fetched router-model list and, when it is absent, substitutes the hardcoded default via getValidatedModelId(). LiteLLM is a proxy that fronts arbitrary models and aliases, so a configured ID is the user's explicit selection even when it is absent from the fetched list (custom aliases, incomplete or stale listings, renamed deployments).
Expected behavior
- A configured
litellmModelId is displayed and preserved, regardless of whether it appears in the fetched list.
- The hardcoded default is only used when nothing is configured and a populated list exists.
Description
With the LiteLLM provider, the model ID on the settings screen cannot be changed: after picking a model (e.g. via "Use custom model..."), the picker silently reverts to the hardcoded default (
claude-3-7-sonnet-20250219). The user's selection is not displayed afterwards, so the setting appears broken.Steps to reproduce
/modelslist (e.g. a custom alias) via "Use custom model...".Root cause
The LiteLLM case in
webview-ui/src/components/ui/hooks/useSelectedModel.tsvalidates the configuredlitellmModelIdagainst the fetched router-model list and, when it is absent, substitutes the hardcoded default viagetValidatedModelId(). LiteLLM is a proxy that fronts arbitrary models and aliases, so a configured ID is the user's explicit selection even when it is absent from the fetched list (custom aliases, incomplete or stale listings, renamed deployments).Expected behavior
litellmModelIdis displayed and preserved, regardless of whether it appears in the fetched list.