Skip to content

[Bug] Studio: raw external:: model id shown in the UI when a connected provider drops the selected model #8405

Closed

Description

@danielhanchen

Summary

When a connected provider stops offering a model that is currently selected, the UI shows the raw internal model id instead of a name:

external::6235be0905af4221::kimi-k2.5

Repro from the reporter: select a model from a connection, go to Connections, pick the loaded provider (Ollama in this case), Fetch Models, where that model is no longer available.

The id itself is fine

studio/frontend/src/features/chat/external-providers.ts:277:

export function buildExternalModelId(providerId: string, modelId: string): string {
  return `${EXTERNAL_MODEL_PREFIX}${providerId}::${encodeURIComponent(modelId)}`;
}

with parseExternalModelId at :281 decoding it back. The display paths I checked all use the parsed modelId rather than the raw string, for example features/chat/runtime-provider.tsx:196, features/chat/shared-composer.tsx:663 and features/chat/api/chat-adapter.ts:4224.

So this is not a format problem. Some render path prints checkpoint verbatim, and it is reached exactly when the model has disappeared from provider.models, so the friendly-name lookup misses and falls through to the raw value.

I have not pinned the component; it needs a UI repro rather than a grep, which is why there is no file:line for the offending render below.

Two things worth fixing together

  1. Parse before displaying, so the fallback reads kimi-k2.5 rather than the internal id.
  2. Say what happened. A model vanishing from a provider's list is the expected trigger here, not an edge case, so "this model is no longer offered by " is more useful than any name on its own.

Activity

  1. danielhanchen commented on Aug 11, 2026

    @danielhanchen
    MemberAuthor

    Pinned it. The renderer is the ModelSelector fallback, i.e. the chat header model pill.

    studio/frontend/src/features/model-picker/components/model-selector.tsx:773-785:

    const currentModel = useMemo(() => {
      if (!selected) return undefined;
      const found = optionById.get(selected);
      // No catalog entry (yet, or ever); a cached GGUF's checkpoint is a snapshot path.
      const fallbackName = modelDisplayName(selected);
      ...
      return found ?? { id: selected, name: fallbackName };
    }, [selected, optionById, activeGgufVariant]);

    rendered verbatim at model-selector.tsx:257 as {currentModel?.name ?? placeholder}.

    Why the fallback prints the raw id rather than shortening it

    modelDisplayName (studio/frontend/src/features/hub/lib/model-identity.ts:146-153) is an exact identity function for this input. Running its predicate chain against the reported id:

    id                  : external::6235be0905af4221::kimi-k2.5
    id[1]               : "x"      (a ":" here is what marks a drive-letter path)
    looksLikeModelPath  : false     no .gguf, no / ~ ./ prefix, fewer than two slashes, no backslash
    isHubRepoId         : false     slash count is 0, not 1
    modelDisplayName -> : external::6235be0905af4221::kimi-k2.5
    

    publicModelId returns the string untouched because it is not path-shaped, then clean.slice(clean.lastIndexOf("/") + 1) with no slash present returns the whole string. So the helper cannot shorten this id, and model-selector.tsx does not import parseExternalModelId at all.

    Why the lookup misses in the first place

    optionById (model-selector.tsx:724-769) is keyed from models, loraModels and externalModels, and the external entries are built in chat-page.tsx:3026-3066 from provider.models only. Once Fetch Models refreshes the provider and drops kimi-k2.5, that id leaves externalModels and the lookup misses.

    Nothing prunes the stale selection: chat-page.tsx:2015-2025 clears the checkpoint only when connections are disabled, and sync-external-providers.ts:160-210 replaces models wholesale with no reconciliation against the active checkpoint. So the id survives in params.checkpoint with no catalog entry behind it, which is exactly the state the fallback was written for.

    Fix

    Two parts, and the second is the one that actually matters to a user.

    1. In model-selector.tsx:773-785, derive the label via parseExternalModelId(selected)?.modelId before falling back to modelDisplayName(selected). message-response-details-sheet.tsx:241-254 already does this well and is worth copying: it parses first, then falls through a label chain.
    2. Say the model is gone. A provider dropping a model is the expected trigger here, so "kimi-k2.5 is no longer offered by " beats any name on its own.

    Related, same helper, not this repro

    shared-composer.tsx:1166-1169 has a local modelDisplayName that splits on / only, so compare-mode load-error toasts (:1403, :1422) would leak the raw id the same way. Worth fixing alongside.

    Two others use the unsafe helper but are not reachable with an external:: id: apply-inference-status-to-store.ts:118 is fed from backend /api/inference/status, which never holds one, and loaded-models-api.ts:192 explicitly bails on isExternalModelId first.

  2. added a commit that references this issue on Aug 12, 2026
    3d32db7
  3. added a commit that references this issue on Aug 12, 2026
    dfae53b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions