Skip to content

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
NousResearch:mainfrom
RelaxJonh:fix/model-picker-provider-key
Open

fix(model-picker): use config key instead of display-name slug for named custom providers (#75087)#75129
RelaxJonh wants to merge 1 commit into
NousResearch:mainfrom
RelaxJonh:fix/model-picker-provider-key

Conversation

@RelaxJonh

Copy link
Copy Markdown
Contributor

Summary

Fixes #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 — exactly backwards.

When a user selects a provider via the interactive hermes model picker, the slug is saved to model.provider. resolve_provider_full() then does a direct providers_dict.get() 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.

-            key = "custom:" + name.lower().replace(" ", "-")
             provider_key = (entry.get("provider_key") or "").strip()
             if provider_key:
-                try:
-                    resolve_provider(provider_key)
-                except AuthError:
-                    key = provider_key
+                key = provider_key
+            else:
+                key = "custom:" + name.lower().replace(" ", "-")

Testing

  • Configured a named custom provider with a config key different from its display name (e.g. providers: { litellm: { name: "LiteLLM Proxy", ... } })
  • Ran hermes model and selected the provider
  • Verified model.provider is saved as litellm (not custom:litellm-proxy)
  • Verified no "Unknown provider" warnings in subsequent resolution

…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.
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard area/config Config system, migrations, profiles P2 Medium — degraded but workaround exists sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Jul 31, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:3154 changes the temporary selected key, but _model_flow_named_custom() still writes model.provider as custom:<provider_key> in hermes_cli/model_setup_flows.py:1638-1641.
  • That value still misses the keyed providers: entry: resolve_user_provider() uses user_config.get(name) at hermes_cli/providers.py:685, so custom:litellm does not resolve providers.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.

Comment thread hermes_cli/main.py
resolve_provider(provider_key)
except AuthError:
key = provider_key
key = provider_key

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hermes model picker saves model.provider as display-name-derived slug instead of config key for providers: entries

3 participants