Skip to content

fix(cli): prefer auth.py env vars over models.dev in provider detection#6755

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-3f221b1b
Apr 9, 2026
Merged

fix(cli): prefer auth.py env vars over models.dev in provider detection#6755
teknium1 merged 1 commit into
mainfrom
hermes/hermes-3f221b1b

Conversation

@teknium1

@teknium1 teknium1 commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Summary

list_authenticated_providers() in model_switch.py was using env var names from the external models.dev registry to detect whether a provider has credentials. This registry has incorrect mappings for 5 providers:

Provider auth.py (correct) models.dev (wrong)
minimax-cn MINIMAX_CN_API_KEY MINIMAX_API_KEY
zai GLM_API_KEY / ZAI_API_KEY / Z_AI_API_KEY ZHIPU_API_KEY
opencode-zen OPENCODE_ZEN_API_KEY OPENCODE_API_KEY
opencode-go OPENCODE_GO_API_KEY OPENCODE_API_KEY
kilocode KILOCODE_API_KEY KILO_API_KEY

The fix: check PROVIDER_REGISTRY from auth.py first (our source of truth for env var names), falling back to models.dev only for providers not in our registry.

Test plan

  • E2E verified: all 5 previously-broken providers now detected when their correct env var is set
  • Regression check: providers that already worked (anthropic, etc.) still detected
  • Full hermes_cli/ suite: 1512 passed (4 pre-existing env_loader failures from test pollution, confirmed on unmodified main)

Fixes #6620. Based on @devorun's investigation in PR #6625.

list_authenticated_providers() was using env var names from the external
models.dev registry to detect credentials. This registry has incorrect
mappings for 5 providers: minimax-cn, zai, opencode-zen, opencode-go,
and kilocode — causing them to not appear in /model even when the
correct API key is set.

Now checks PROVIDER_REGISTRY from auth.py first (our source of truth),
falling back to models.dev only for providers not in our registry.

Fixes #6620. Based on devorun's investigation in PR #6625.
@teknium1 teknium1 merged commit ee16416 into main Apr 9, 2026
4 of 6 checks passed
Tommyeds pushed a commit to Tommyeds/hermes-agent that referenced this pull request Apr 12, 2026
…on (NousResearch#6755)

list_authenticated_providers() was using env var names from the external
models.dev registry to detect credentials. This registry has incorrect
mappings for 5 providers: minimax-cn, zai, opencode-zen, opencode-go,
and kilocode — causing them to not appear in /model even when the
correct API key is set.

Now checks PROVIDER_REGISTRY from auth.py first (our source of truth),
falling back to models.dev only for providers not in our registry.

Fixes NousResearch#6620. Based on devorun's investigation in PR NousResearch#6625.
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…on (NousResearch#6755)

list_authenticated_providers() was using env var names from the external
models.dev registry to detect credentials. This registry has incorrect
mappings for 5 providers: minimax-cn, zai, opencode-zen, opencode-go,
and kilocode — causing them to not appear in /model even when the
correct API key is set.

Now checks PROVIDER_REGISTRY from auth.py first (our source of truth),
falling back to models.dev only for providers not in our registry.

Fixes NousResearch#6620. Based on devorun's investigation in PR NousResearch#6625.
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…on (NousResearch#6755)

list_authenticated_providers() was using env var names from the external
models.dev registry to detect credentials. This registry has incorrect
mappings for 5 providers: minimax-cn, zai, opencode-zen, opencode-go,
and kilocode — causing them to not appear in /model even when the
correct API key is set.

Now checks PROVIDER_REGISTRY from auth.py first (our source of truth),
falling back to models.dev only for providers not in our registry.

Fixes NousResearch#6620. Based on devorun's investigation in PR NousResearch#6625.
olympus-terminal pushed a commit to olympus-terminal/hermes-agent that referenced this pull request May 16, 2026
…on (NousResearch#6755)

list_authenticated_providers() was using env var names from the external
models.dev registry to detect credentials. This registry has incorrect
mappings for 5 providers: minimax-cn, zai, opencode-zen, opencode-go,
and kilocode — causing them to not appear in /model even when the
correct API key is set.

Now checks PROVIDER_REGISTRY from auth.py first (our source of truth),
falling back to models.dev only for providers not in our registry.

Fixes NousResearch#6620. Based on devorun's investigation in PR NousResearch#6625.
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…on (NousResearch#6755)

list_authenticated_providers() was using env var names from the external
models.dev registry to detect credentials. This registry has incorrect
mappings for 5 providers: minimax-cn, zai, opencode-zen, opencode-go,
and kilocode — causing them to not appear in /model even when the
correct API key is set.

Now checks PROVIDER_REGISTRY from auth.py first (our source of truth),
falling back to models.dev only for providers not in our registry.

Fixes NousResearch#6620. Based on devorun's investigation in PR NousResearch#6625.
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…on (NousResearch#6755)

list_authenticated_providers() was using env var names from the external
models.dev registry to detect credentials. This registry has incorrect
mappings for 5 providers: minimax-cn, zai, opencode-zen, opencode-go,
and kilocode — causing them to not appear in /model even when the
correct API key is set.

Now checks PROVIDER_REGISTRY from auth.py first (our source of truth),
falling back to models.dev only for providers not in our registry.

Fixes NousResearch#6620. Based on devorun's investigation in PR NousResearch#6625.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] minimax-cn provider not shown in /model list despite MINIMAX_CN_API_KEY being set

1 participant