Skip to content

fix: show custom models in combo picker for providers with short aliases#749

Open
zerray wants to merge 1 commit intodecolua:masterfrom
zerray:pr/combo-custom-model-fix
Open

fix: show custom models in combo picker for providers with short aliases#749
zerray wants to merge 1 commit intodecolua:masterfrom
zerray:pr/combo-custom-model-fix

Conversation

@zerray
Copy link
Copy Markdown

@zerray zerray commented Apr 24, 2026

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:

  • Write pathsrc/app/(dashboard)/dashboard/providers/[id]/page.js uses getProviderAlias(providerId) (from src/shared/constants/providers.js, reading AI_PROVIDERS[id].alias). For DeepSeek this returns "ds", so the alias is stored as modelAliases["foo"] = "ds/foo".
  • Read pathsrc/shared/components/ModelSelectModal.js filters custom models with PROVIDER_ID_TO_ALIAS[providerId] (from open-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.js ALIAS_TO_PROVIDER_ID explicitly accepts both ds and deepseekdeepseek, which is why Test succeeds and real requests route correctly. The bug is display-only in the combo picker.

Affected providers

Any provider where AI_PROVIDERS[id].alias !== id and the id is not in OAUTH_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 orphaned ds/… entries become visible immediately.

Providers where getProviderAlias(id) === PROVIDER_ID_TO_ALIAS[id] (most of them) are unaffected.

Test plan

  • Dashboard → API Key Providers → DeepSeek → Add Custom Model (e.g. deepseek-chat-custom) → Save
  • Combo form → Select Model → DeepSeek group now lists the custom model with a custom badge
  • Existing combos referencing built-in DeepSeek models still render and route correctly
  • Non-short-alias providers (OpenAI, Anthropic, Claude, etc.) behave unchanged

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant