fix: show custom models in combo picker for providers with short aliases#749
Open
zerray wants to merge 1 commit intodecolua:masterfrom
Open
fix: show custom models in combo picker for providers with short aliases#749zerray wants to merge 1 commit intodecolua:masterfrom
zerray wants to merge 1 commit intodecolua:masterfrom
Conversation
The provider detail page writes modelAliases using `getProviderAlias()`
(e.g. "ds/foo" for DeepSeek), but ModelSelectModal was filtering with
`PROVIDER_ID_TO_ALIAS` (e.g. "deepseek/"). The two sources of truth
diverged for API-key providers whose AI_PROVIDERS.alias differs from
their id — deepseek ("ds"), perplexity ("pplx"), hyperbolic ("hyp"),
blackbox ("bb"), chutes ("ch"), huggingface ("hf"), deepgram ("dg"),
assemblyai ("aai"), nanobanana ("nb"), elevenlabs ("el"), brave-search
("brave"), vertex-partner ("vxp"), opencode-go ("ocg"),
volcengine-ark ("ark") — so newly added custom models never appeared
in the combo model picker.
Align the picker with the write path. Routing already accepts both
prefixes (open-sse/services/model.js ALIAS_TO_PROVIDER_ID maps
"ds" and "deepseek" to "deepseek"), so no migration is needed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When users add a custom model to an API-key provider with a short alias (e.g. DeepSeek →
ds) from the dashboard, the model saves and tests successfully but never appears in the combo model picker.Root cause
Two independent provider-alias mappings diverge for a subset of API-key providers:
src/app/(dashboard)/dashboard/providers/[id]/page.jsusesgetProviderAlias(providerId)(fromsrc/shared/constants/providers.js, readingAI_PROVIDERS[id].alias). For DeepSeek this returns"ds", so the alias is stored asmodelAliases["foo"] = "ds/foo".src/shared/components/ModelSelectModal.jsfilters custom models withPROVIDER_ID_TO_ALIAS[providerId](fromopen-sse/config/providerModels.js, only covers OAuth short aliases). For DeepSeek this returns"deepseek", so"ds/foo".startsWith("deepseek/")is false and the model is filtered out.Routing itself is unaffected —
open-sse/services/model.jsALIAS_TO_PROVIDER_IDexplicitly accepts bothdsanddeepseek→deepseek, which is whyTestsucceeds and real requests route correctly. The bug is display-only in the combo picker.Affected providers
Any provider where
AI_PROVIDERS[id].alias !== idand the id is not inOAUTH_ALIASES:deepseek(ds),perplexity(pplx),hyperbolic(hyp),blackbox(bb),chutes(ch),huggingface(hf),deepgram(dg),assemblyai(aai),nanobanana(nb),elevenlabs(el),brave-search(brave),vertex-partner(vxp),opencode-go(ocg),volcengine-ark(ark).Fix
Align the combo picker with the write path by using
getProviderAlias(providerId). Since routing accepts both prefixes, no data migration is needed — existing orphanedds/…entries become visible immediately.Providers where
getProviderAlias(id) === PROVIDER_ID_TO_ALIAS[id](most of them) are unaffected.Test plan
deepseek-chat-custom) → Savecustombadge🤖 Generated with Claude Code