Repository navigation
fix(models): exclude custom providers from deferred model cache - #1458
Merged
Merged
Conversation
Reshwell
marked this pull request as ready for review
October 29, 2026 11:24
Owner
|
Thanks, this looks good to merge. Checked on a scratch merge with current main (pi 1.4.0):
|
windli2018
pushed a commit
to aiti-ai/aiti-ai
that referenced
this pull request
Nov 6, 2026
…r#1458) * fix(models): exclude custom providers from deferred model cache * fix(models): preserve deferred virtual models * fix(models): ignore models removed during availability checks
windli2018
pushed a commit
to aiti-ai/aiti-ai
that referenced
this pull request
Nov 8, 2026
…r#1458) * fix(models): exclude custom providers from deferred model cache * fix(models): preserve deferred virtual models * fix(models): ignore models removed during availability checks
windli2018
pushed a commit
to aiti-ai/aiti-ai
that referenced
this pull request
Nov 8, 2026
…r#1458) * fix(models): exclude custom providers from deferred model cache * fix(models): preserve deferred virtual models * fix(models): ignore models removed during availability checks
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.
Problem
After a custom provider has appeared in the model picker, renaming or deleting it in Settings → Models and saving leaves its old id in subsequent model listings. The saved
models.jsonis correct, but the process-wide deferred-provider catalog remembers every available provider. A fresh runtime no longer contains the old id, so the fallback adds it back as though an extension had deferred its registration.Reproduction on main
After this change, a renamed provider appears only under its new id, and a deleted provider is no longer offered.
Change
Only remember models from explicit extension/native provider registrations and virtual models. Use the public SDK methods
getRegisteredProviderIds(),getModel(), andgetPhysicalModel()to distinguish these from ordinary physical models defined only inmodels.json. Virtual-only providers are not included in the registration-id list, so they remain eligible when the model still exists and has no physical counterpart. Requiring that current model also prevents a physical model removed during an asynchronous availability check from being mistaken for a virtual model. Deferred extension providers continue to work as introduced in #1071, without clearing their registrations on every config save.Add unit coverage for provider filtering, virtual models, and concurrent removal, plus real-SDK regression tests for rename and deletion. The latter write the actual configuration file, verify that deferred physical and virtual extension models remain available, and check that a pre-save runtime cannot reintroduce the old custom provider. Update the model-runtime notes.
Validation
node node_modules/typescript/bin/tsc --noEmit: passed.npm run lint: passed.git diff --check: passed.npm teston Windows / Node 24.21.0: 3075 passed, 39 failed, 23 skipped. A clean checkout of the same base (377c012) reports 3069 passed, 40 failed, 23 skipped. All 39 failing tests also failed in the clean baseline run; the baseline additionally had an intermittent failure inmcp-host.integration.test.mjs. That file passes 11/11 when run separately on both the base and the fix. The full suite is therefore not green locally; this PR does not change the unrelated tests.