Repository navigation
Conversation
Name the providers/openwhispr check once (usesCloudModelCatalog) for the three reconciliation paths, correct the unset-mode comment, and split the regression test into one case per path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chadpiha
self-requested a review
October 19, 2026 23:52
…ders Restarts no longer repair a Self-Hosted scope's model, so a switch back to Providers kept that id under the scope's old cloud provider and sent it to Groq (for example) until the next restart. The mode switch now clears a model the kept provider doesn't serve, so the picker asks for one. Also covers the reported path in the regression test: Chat in Self-Hosted with its provider left at the Groq default, through initializeSettings().
Chadpiha
approved these changes
Oct 20, 2026
Chadpiha
left a comment
Collaborator
There was a problem hiding this comment.
Thanks @Jrjy3, great catch and a clean, well-scoped fix. Approving.
I traced all three repair paths end to end. Mode values match InferenceMode and are stored as plain strings. The startup filter runs after every mode migration. Profiles with no saved mode still load as openwhispr and get repaired, and the vision override (hard-coded to providers) is still reconciled. Your new test fails 9 cases on main and passes on the branch, and the related settings and model suites all pass.
I pushed one follow-up commit (60af471):
- Switching back to Providers: restarts no longer overwrite a Self-Hosted model, so switching a scope back to Providers kept that model id under the old cloud provider (e.g. Groq) until the next restart. The mode switch now clears a model the kept provider doesn't serve (
modeSwitchPatchinsrc/utils/llmModeSwitch.ts), so the picker asks for one. - Test of the reported path: Chat in Self-Hosted with its provider left at the Groq default, run through
initializeSettings(), plus a Providers check that the repair still runs.
Not blocking, for later:
- The startup sweep reads the mode as stored, while the store maps unknown values to
openwhispr, so an unrecognised stored mode skips the one-time sweep. - The one-time sweep marks itself done even for the scopes it skipped.
…ed-models # Conflicts: # src/components/settings/InferenceConfigEditor.tsx
This branch has not been deployed
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.
Fixes #2789
Problem
A Self-Hosted model selection doesn't survive a restart. Every time the app starts, Self-Hosted stays selected but its model changes to a cloud provider's default, for example
openai/gpt-oss-120b, and the change is saved. Requests then ask the self-hosted server to load that model, which the user's machine may not be able to run, and the user has to select their model again after every launch.This happens whenever the scope's saved provider is a cloud provider, which is always the case for Chat: its provider defaults to Groq, so a Self-Hosted Chat model is reset on every restart even if the user never picked a cloud provider. Other scopes hit it as soon as they have used a cloud provider before switching to Self-Hosted.
Root cause
Every mode stores its model in the scope's one
<scope>Modelkey, but<scope>Providerkeeps the last cloud provider after switching to Self-Hosted. All three cloud-model reconciliation paths check the model against that provider's catalog without looking at the scope's mode:migrateRetiredCloudModels)reconcileRetiredCloudModelSelections)reconcileSelectedModels)A self-hosted model id isn't in the Groq or Tinfoil catalog, so it gets "repaired."
Fix
Each path now skips a scope unless its mode uses a cloud catalog (
usesCloudModelCatalog:providersoropenwhispr). Self-Hosted, Local and Enterprise selections are left as they are. Cloud modes keep the existing retirement handling, including profiles with no saved mode, which load asopenwhispr. The screen-context vision override is alwaysproviders, so it is still reconciled.Tests
test/helpers/selfHostedModelPersistence.test.js: Dictation Cleanup, Voice Assistant, Note Formatting, Chat and Translation, in all five modes, across all three paths. It checks the store and persisted storage, and that a Tinfoil switch notice appears only when a cloud selection is replaced. The 9 Self-Hosted, Local and Enterprise cases fail without the fix.reasoningModelMemory,retiredCloudModels,settingsStoreRetiredGroqModels,tinfoilDefaultModel(54 tests total, Node 24.22).mainit comes back asopenai/gpt-oss-120b.Known limitations
A selection already overwritten by an earlier launch isn't restored. It has to be picked again once, and from then on it stays.