fix: hide hidden base models in the automations model selector

The `/api/models` response intentionally includes base models marked as
hidden (`info.meta.hidden`) because they may be required to resolve
Workspace Models. Every user-facing model selector therefore filters them
out client-side, but the Automations model dropdown listed the raw
`$models` store and so exposed hidden base models for selection.

Filter the dropdown's selectable list with the same
`!(model?.info?.meta?.hidden ?? false)` predicate already used by the
chat, notes and pinned-model selectors. The label lookup is left
untouched so an automation already configured with a hidden model keeps
displaying its name.

Closes #24869
This commit is contained in:
Asish Kumar 2026-05-25 08:42:51 +05:30
parent 42783881e9
commit af861a7aa5
No known key found for this signature in database
GPG key ID: 0EF072B1E0BA6FBA

View file

@ -24,13 +24,19 @@
? $models.find((m) => m.id === model_id)?.name || model_id
: $i18n.t('Select model');
// Hidden base models are returned by the API for resolving Workspace Models,
// but should not be user-selectable here (consistent with the chat, notes and
// pinned-model selectors). The label above intentionally still resolves a
// hidden model so existing automations keep showing the correct name.
$: selectableModels = $models.filter((m) => !(m?.info?.meta?.hidden ?? false));
$: filteredModels = modelSearch
? $models.filter(
? selectableModels.filter(
(m) =>
m.name.toLowerCase().includes(modelSearch.toLowerCase()) ||
m.id.toLowerCase().includes(modelSearch.toLowerCase())
)
: $models;
: selectableModels;
</script>
<Dropdown bind:show={showDropdown} {side} {align}>