fix: require non-empty credential pool entries in provider listing#26934
Closed
pinguarmy wants to merge 1 commit into
Closed
fix: require non-empty credential pool entries in provider listing#26934pinguarmy wants to merge 1 commit into
pinguarmy wants to merge 1 commit into
Conversation
The credential pool check only verified that a provider ID existed as a key in the credential_pool dict, not that the entry had actual credentials. An empty list [] (leftover from removed env vars like KIMI_CN_API_KEY) was treated as 'authenticated', causing phantom providers to appear in the /model picker. Fix: check that pool_creds is non-empty before marking the provider as having credentials.
Collaborator
Author
|
Thanks @alt-glitch — I see #20705 was submitted earlier and uses the proper pattern consistent with the sections 2/2b fix from #19669. That's the better approach. I'll close this PR in favour of #20705. Appreciate the pointer! |
Author
|
Closing in favour of #20705 which addresses the same issue with a more thorough approach using load_pool().has_credentials(). |
Author
|
This fix is already present in the current codebase. model_switch.py:1386 uses .get(hermes_id) which returns falsy for empty lists, preventing phantom providers from appearing in the /model picker. |
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
The
list_authenticated_providers()function inmodel_switch.pyhas a bug where empty credential pool entries (e.g.\kimi-coding-cn\: []) are treated as valid authentication, causing phantom providers to appear in the/modelpicker.The credential check only verified that a provider ID existed as a key in the
credential_pooldict — it did not check whether the entry had actual credentials.Reproduction
.env→ credential_pool entry created inauth.json.env→ credential_pool still has\kimi-coding-cn\: []/modelin TUI → kimi still appears in the provider list even though no key existsFix
Changed the credential pool check to require non-empty entries:
This is both corrective (the stale empty entry should be cleaned up) and defensive (prevents future empty entries from causing phantom providers).
Test Plan
[]or missing entries no longer appear as authenticated providersCloses #—