fix(model-picker): use config key instead of display-name slug for named custom providers (#75087) - #75129
Open
RelaxJonh wants to merge 1 commit into
Open
Conversation
…med custom providers (NousResearch#75087) `select_provider_and_model()` generated the picker key for named custom providers as `custom:<name-lowercased-and-spaces-replaced>`, derived from the display name. The actual config key under `providers:` was only used when `resolve_provider()` raised AuthError — i.e. exactly backwards. When a user selects a provider via the interactive picker, the slug is saved to `model.provider`. `resolve_provider_full()` then does a direct `providers_dict.get()` lookup with that slug, which returns None because the real key is different. The agent still works at runtime via the credential-pool fallback, but any code path using `resolve_provider_full()` (most prominently the Desktop model-switch menu) triggers "Unknown provider" warnings and falls back to default settings. Fix: always use `provider_key` when available, fall back to the display-name slug only when no config key exists.
teknium1
reviewed
Jul 31, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for tracing the display-name/config-key mismatch. The premise is real, but this patch changes only the picker map and does not complete the persistence contract.
Problems
hermes_cli/main.py:3154changes the temporary selected key, but_model_flow_named_custom()still writesmodel.providerascustom:<provider_key>inhermes_cli/model_setup_flows.py:1638-1641.- That value still misses the keyed
providers:entry:resolve_user_provider()usesuser_config.get(name)athermes_cli/providers.py:685, socustom:litellmdoes not resolveproviders.litellm.
Suggested changes
- Update the persistence/resolution path so the selected identity is resolvable end-to-end, and add a picker-level regression test for a config key that differs from its display name.
Automated hermes-sweeper review.
| resolve_provider(provider_key) | ||
| except AuthError: | ||
| key = provider_key | ||
| key = provider_key |
Contributor
There was a problem hiding this comment.
This only changes the picker-map key. _model_flow_named_custom() still persists model.provider as custom:<provider_key> (hermes_cli/model_setup_flows.py:1638-1641), while resolve_user_provider() looks up the raw value with user_config.get(name) (hermes_cli/providers.py:685). Please update that persistence/resolution path and add an end-to-end keyed-provider regression test.
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
Fixes #75087.
select_provider_and_model()generated the picker key for named custom providers ascustom:<name-lowercased-and-spaces-replaced>, derived from the display name. The actual config key underproviders:was only used whenresolve_provider()raisedAuthError— exactly backwards.When a user selects a provider via the interactive
hermes modelpicker, the slug is saved tomodel.provider.resolve_provider_full()then does a directproviders_dict.get()with that slug, which returnsNonebecause the real key is different. The agent still works at runtime via the credential-pool fallback, but any code path usingresolve_provider_full()(most prominently the Desktop model-switch menu) triggers "Unknown provider" warnings and falls back to default settings.Fix
Always use
provider_keywhen available; fall back to the display-name slug only when no config key exists.Testing
providers: { litellm: { name: "LiteLLM Proxy", ... } })hermes modeland selected the providermodel.provideris saved aslitellm(notcustom:litellm-proxy)