fix(desktop): preserve other providers' hide-all in model visibility dialog (salvage #47450) - #50100
Merged
kshitijk4poor merged 2 commits intoJun 21, 2026
Conversation
…dialog NousResearch#43496 added a per-provider hide-all sentinel ('provider::') so emptying a provider in the Edit Models dialog stopped re-expanding its defaults. That fixed the single-provider case, but the dialog's toggle handler seeds its working set from effectiveVisibleKeys(), which strips ALL sentinels before returning. So persisting after any toggle silently dropped every OTHER provider's hide-all sentinel; those providers then looked 'never customized' and re-enabled all their models on the next render. Split resolution into two functions: - resolveVisibleKeys(): stored keys + curated default expansion, with hide-all sentinels PRESERVED — the canonical working set the toggle handler mutates and persists. - effectiveVisibleKeys(): resolveVisibleKeys() then strips sentinels, for display only (unchanged contract). Move the toggle set-computation into a pure, unit-tested toggleModelVisibility() that seeds from resolveVisibleKeys(), so sibling sentinels survive the persist. Add regression tests that drive the real toggle handler across multiple providers. Follow-up to NousResearch#43496; completes the fix for NousResearch#43485 (cross-provider case).
Follow-up to the salvaged NousResearch#47450 fix: - Extract expandProviderDefaults() so the curated-default expansion rule lives in one place (was duplicated between defaultVisibleKeys and resolveVisibleKeys). - Drop the redundant new Set() wrap in toggleModelVisibility (resolveVisibleKeys already returns a fresh Set; effectiveVisibleKeys already relied on this). - Document the intentional re-enable behavior (re-enabling one model of a hidden-all provider restores only that model, not the curated defaults) and tighten the toggleModelVisibility JSDoc. - Add 7 hardening tests: re-enable-restores-only-that-model, full hide/re-enable round-trip, empty-non-null stored, single toggle-off from null defaults, zero-model provider, and direct resolveVisibleKeys null/empty assertions.
Collaborator
|
Related: #47450 (the predecessor this salvages, by @cyb0rgk1tty), #43496 (merged fix for the single-provider case), #43485 (original bug report). This PR extends the fix to the cross-provider case that #43496 left open, with authorship preserved plus a follow-up hardening commit. |
kshitijk4poor
enabled auto-merge
June 21, 2026 10:24
This was referenced Jun 21, 2026
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…l-visibility-cross-provider-47450 fix(desktop): preserve other providers' hide-all in model visibility dialog (salvage NousResearch#47450)
habarmc1223-sudo
pushed a commit
to habarmc1223-sudo/hermes-agent-fluxmem
that referenced
this pull request
Jul 8, 2026
…l-visibility-cross-provider-47450 fix(desktop): preserve other providers' hide-all in model visibility dialog (salvage NousResearch#47450)
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
…l-visibility-cross-provider-47450 fix(desktop): preserve other providers' hide-all in model visibility dialog (salvage NousResearch#47450)
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…l-visibility-cross-provider-47450 fix(desktop): preserve other providers' hide-all in model visibility dialog (salvage NousResearch#47450)
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
…l-visibility-cross-provider-47450 fix(desktop): preserve other providers' hide-all in model visibility dialog (salvage NousResearch#47450)
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
Emptying every model for a provider in the Edit Models dialog now stays empty when you touch a different provider — the cross-provider gap left by #43496 (which only fixed the single-provider case of #43485).
Root cause:
effectiveVisibleKeys()strips all hide-all sentinels (correct for display), but the dialog'stoggle()seeded its working set fromeffectiveVisibleKeys()and then persisted it — so every toggle silently discarded every other provider's sentinel. On the next render those providers looked "never customized" and had their curated defaults re-added.Salvage of #47450 by @cyb0rgk1tty (David Doan), cherry-picked onto current
mainwith authorship preserved, plus a follow-up hardening commit by me.Changes
model-visibility.ts(contributor): splitresolveVisibleKeys(stored, providers)— the canonical working set with sentinels preserved — fromeffectiveVisibleKeys()(display, sentinels stripped, contract unchanged). Extract the dialog's toggle logic into a puretoggleModelVisibility()seeded fromresolveVisibleKeys(), so sibling sentinels survive the persist.model-visibility-dialog.tsx(contributor): dialog now just callssetVisibleModels(toggleModelVisibility(...)).expandProviderDefaults()so the curated-default expansion rule lives in one place (was duplicated betweendefaultVisibleKeysandresolveVisibleKeys); drop a redundantnew Set()wrap; document the intentional re-enable-restores-only-that-model behavior; tighten JSDoc; add 7 hardening tests (round-trip re-hide, empty-non-null stored, single toggle-off from defaults, zero-model provider, directresolveVisibleKeysnull/empty asserts).Validation
effectiveVisibleKeysdisplay contractmainby replaying the old inline toggle logic (cross-provider snap-back confirmed).npx vitest run --environment jsdom src/store/model-visibility.test.ts→ 18 passed (11 original + 7 new).src/store/suite → 192 passed (20 files), no regressions.npm run typecheckclean.eslintclean on all changed files.Follow-up to #43496; completes the fix for #43485 (cross-provider case). Closes #47450 (salvaged here with authorship preserved). Supersedes the stale #44170, which targets the same bug class against pre-#43496 code with a heavier
$knownProviders-store approach.