Repository navigation
Conversation
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.
Problem
Settings → Models stores the selection in Pi's shared
enabledModels. Signing out of a provider removes its models fromgetAvailable(), but does not make the saved selection invalid.Previously, the same signed-out entries:
The original version of this PR addressed only the first symptom. This revision uses a shared catalog classification for chat diagnostics, Settings and cleanup instead. There is no separate preference file, no new setting, and no background or bidirectional synchronization.
Reproduction on main
enabledModels.No models match pattern "provider/model"warnings even though the other provider works.Fix
resolveUnavailableModelPatterns()classifies entries that match no available model against the full catalog, using Pi's resolver for the existing pattern syntax (including globs, fuzzy patterns, nested IDs and thinking pins). Ambiguous bare exact IDs and malformed entries are not classified as known picks.Auth classification uses
getProviderAuthStatus().configured, not the availability-onlyhasConfiguredAuth(), so stored-but-failing credentials are not silently treated as a sign-out.The Models API carries
unavailablePatternsseparately fromstalePatterns. Reads and authentication/catalog changes do not rewriteenabledModels. Explicit cleanup preserves unavailable entries' original spelling, order and thinking pins, including when none of the selected models is available. Existing global/project precedence, project read-only controls, known rename handling and SDK scope fallback remain intact. Signing back in makes the saved entries usable again.No Pi CLI behavior or configuration format changes. Its own diagnostics are unchanged. A catalog miss is not proof of permanent deletion (it may be another machine's entry); removal remains a deliberate user action. UI notes are translated in English, Simplified Chinese and Traditional Chinese.
Related work
enabledModelsin settings.json when a connector/models are removed → persistent 'No models match pattern' warnings #560 / After model deletion, the pi-web UI still displays "Model scope warnings," and the newly added Kimi K3 is not in the model dropdown list. #640: related unmatched-selection behavior. This PR does not add implicit pruning or a second preference store.Validation
npm test: 2,884 passed, 1 skipped, 0 failed (the skipped test is Windows-junction-only).npx tsc --noEmit: passed.npx eslint .: passed.Local checks ran serially in a CPU/memory-limited scope, without Linux DAC-override capabilities for the existing read-only-directory test. No production service was modified or restarted.