Skip to content

fix(desktop): structured Fallback Models editor + out-of-catalog model visibility - #47522

Closed
MarkVLK wants to merge 3 commits into
NousResearch:mainfrom
MarkVLK:fix/model-selection-visibility
Closed

fix(desktop): structured Fallback Models editor + out-of-catalog model visibility#47522
MarkVLK wants to merge 3 commits into
NousResearch:mainfrom
MarkVLK:fix/model-selection-visibility

Conversation

@MarkVLK

@MarkVLK MarkVLK commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Problem

In Settings → Model, two things were confusing or broken:

  1. Fallback Models rendered [object Object], [object Object]. fallback_providers is a list of {provider, model} objects, but it was shown through the generic list config field, which does value.join(', ') and stringifies each object.
  2. The model box was blank whenever the configured model wasn't in the selected provider's advertised catalog — e.g. a Nous‑proxied openai/* id, an LM Studio / custom‑endpoint model, or any overridden id. Radix <Select> renders nothing for a value with no matching item, so the page hid what was actually configured.

Both surfaced from a real case where a primary model was misconfigured (a provider/model mismatch that 404'd and silently fell back) and the UI gave no usable signal about what was set or why.

Changes

  • New FallbackModelsField — a structured provider + model row editor (add / remove) for fallback_providers, sourced from the same getGlobalModelOptions() the composer model picker uses. ConfigField renders it for that key instead of the generic list input. Half‑filled rows are kept in local state so the config autosave never persists a partial {provider, model: ''}, and an out‑of‑catalog model stays selectable so existing custom entries still render.
  • Out‑of‑catalog model visibility — the main (and auxiliary) model <Select> now includes the current value as a selectable item even when it isn't in the provider's catalog, and shows a ⚠ note when the configured model isn't in the catalog, so the user knows calls may fall back.
  • i18nsettings.model.{fallbackAdd, fallbackEmpty, notInCatalog} (en + zh; ja / zh‑hant fall back to English via defineLocale).
  • Testsfallback-models-field.test.tsx: each entry renders as its own row (never [object Object]), removing a row emits the remaining entries, adding a blank row never persists a partial pair, and the empty‑state hint.

Old
Screenshot 2026-06-16 at 10 25 40 PM

New
screenshot2

Verification

  • npm run typecheck and eslint clean on the changed files (the two remaining react-hooks/exhaustive-deps warnings in config-settings.tsx are pre‑existing in untouched useEffects).
  • vitest — the 4 new fallback-models-field tests pass. model-settings.test.tsx is unchanged by this PR; its one failing case fails identically on main (pre‑existing, unrelated).

Follow-up (not in this PR)

A "running on a fallback" banner: when the default model is failing and the agent is silently serving from the fallback_providers chain, surface it (e.g. "Default nous/… unavailable — running copilot/…"). Doing this correctly needs a backend fallback_activated signal on session.info — a pure effective‑vs‑configured comparison would false‑positive on intentional per‑session model switches — plus making the agent's self‑report name the effective model. Tracked separately.

🤖 Generated with Claude Code

MarkVLK and others added 3 commits June 16, 2026 17:35
Settings → Model rendered `fallback_providers` (a list of `{provider,
model}` objects) through the generic `list` config field, which does
`value.join(', ')` and stringified each entry to `[object Object],
[object Object]`.

Add a dedicated provider+model row editor (add/remove), sourced from the
same `getGlobalModelOptions()` the composer picker uses, that reads and
writes the `{provider, model}` chain. Half-filled rows are kept in local
state so the config autosave never persists a partial entry, and an
out-of-catalog model stays selectable so existing custom entries render.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The model `<Select>` only listed the provider's advertised catalog, so a
configured model that isn't in it (e.g. a Nous-proxied `openai/*` id, or
any overridden model) rendered as a blank box — hiding what's actually
set. Include the current value as a selectable item, and show a warning
when it isn't in the provider's catalog so the user knows calls may fall
back. Apply the same out-of-catalog guard to the auxiliary model select.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Asserts each {provider, model} entry renders as its own row (the bug
produced "[object Object]"), that removing a row emits the remaining
entries, that adding a blank row never persists a partial pair, and the
empty-state hint.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@alt-glitch alt-glitch added type/bug Something isn't working comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have labels Jun 17, 2026
@MarkVLK
MarkVLK marked this pull request as ready for review June 17, 2026 05:20
@alt-glitch alt-glitch added comp/desktop Electron desktop app (apps/desktop/*) and removed comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels Jun 26, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Salvaged the remaining structured fallback-editor scope into a current-main PR. The out-of-catalog visibility half was already implemented independently, so the salvage keeps only the object-list editor, tests, and profile/config reload hardening while preserving your authorship.

@teknium1 teknium1 closed this Jul 12, 2026
alonre added a commit to alonre/hermes-agent that referenced this pull request Jul 13, 2026
Sync PR #37 pulled PR NousResearch#59778 (desktop: dismiss stale prompt overlays)
by frizikk and PR NousResearch#63080 (desktop: structured Fallback Models editor,
salvaging MarkVLK's work from NousResearch#47522), whose commit emails weren't yet
mapped.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants