fix(model-picker): exclude providers with empty credential pool entries#15950
Closed
kshitijk4poor wants to merge 1 commit into
Closed
fix(model-picker): exclude providers with empty credential pool entries#15950kshitijk4poor wants to merge 1 commit into
kshitijk4poor wants to merge 1 commit into
Conversation
The auth check in list_authenticated_providers used mere key presence in credential_pool to conclude a provider is authenticated. An empty entry (pool_store key with no actual credentials) caused providers like ollama-cloud to appear as authenticated in the model picker even when no OLLAMA_API_KEY was set. The user's picker then offered nemotron-3-super under Ollama Cloud; selecting it routed every subsequent turn to https://ollama.com/v1, which rejected the requests with HTTP 400. Fix: drop the pool_store key-existence check from both section 2 (HERMES_OVERLAYS) and section 2b (CANONICAL_PROVIDERS). The following load_pool().has_credentials() call already handles the legitimate pooled- credential case; checking for an empty key just ahead of it was redundant and actively harmful.
Contributor
|
Salvaged via #19669 onto current main - your commit authorship was preserved. Thanks! |
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
list_authenticated_providerscheckedslug in credential_pool(key existence) to decide a provider is authenticated, but an empty pool entry is not a credentialollama-cloudhad a ghost entry incredential_poolwith no actual key, so it appeared as authenticated in the model picker even with noOLLAMA_API_KEYsetnemotron-3-superfrom the Ollama Cloud section → routed tohttps://ollama.com/v1→ HTTP 400 on every turnpool_storekey-existence check from sections 2 and 2b; theload_pool().has_credentials()call that immediately follows already handles legitimate pooled credentialsTest plan
tests/hermes_cli/test_ollama_cloud_provider.py— 25 tests passtests/hermes_cli/test_model_switch_custom_providers.py— 13 tests passtests/hermes_cli/test_overlay_slug_resolution.py— 5 tests passollama-cloudno longer appears inlist_authenticated_providerswhenOLLAMA_API_KEYis unset (even with a ghost pool entry)pool.has_credentials()