diff --git a/hermes_cli/auth.py b/hermes_cli/auth.py index ad2c48037db1..13f7cf362f6b 100644 --- a/hermes_cli/auth.py +++ b/hermes_cli/auth.py @@ -1605,6 +1605,12 @@ def is_provider_explicitly_configured(provider_id: str) -> bool: # not by the user explicitly configuring anthropic in Hermes. _IMPLICIT_ENV_VARS = {"CLAUDE_CODE_OAUTH_TOKEN"} pconfig = PROVIDER_REGISTRY.get(normalized) + # Fallback to ProviderDef from models.dev catalog when the provider + # isn't in the manually-maintained PROVIDER_REGISTRY (e.g. openrouter). + # Both expose .auth_type and .api_key_env_vars with the same shape. + if pconfig is None: + from hermes_cli.providers import get_provider + pconfig = get_provider(normalized) if pconfig and pconfig.auth_type == "api_key": for env_var in pconfig.api_key_env_vars: if env_var in _IMPLICIT_ENV_VARS: diff --git a/scripts/release.py b/scripts/release.py index fef6b716fd3a..d6ffb4d26026 100755 --- a/scripts/release.py +++ b/scripts/release.py @@ -45,6 +45,7 @@ ACP_REGISTRY_MANIFEST = REPO_ROOT / "acp_registry" / "agent.json" # Auto-extracted from noreply emails + manual overrides AUTHOR_MAP = { + "zzpigpinggai@users.noreply.github.com": "zzpigpinggai", # PR #66017 salvage of #63617 (OpenRouter explicit-provider picker visibility) "sam7894604@gmail.com": "sam7894604", # PR #55803 salvage (discord: /reasoning slash choices) "bryan@users.noreply.github.com": "hydraxman", # PR #62028 salvage (copilot xhigh) — regression-test commit authored under a bare-noreply local git identity; PR author is @hydraxman "antydizajn@gmail.com": "antydizajn", # PR #36043 salvage (auxiliary: route custom: through named-provider arm + Palantir Bearer auth) diff --git a/tests/hermes_cli/test_auth_provider_gate.py b/tests/hermes_cli/test_auth_provider_gate.py index d379bdd262d4..ecb602f588b1 100644 --- a/tests/hermes_cli/test_auth_provider_gate.py +++ b/tests/hermes_cli/test_auth_provider_gate.py @@ -171,3 +171,22 @@ def test_env_pool_entry_counts_when_var_still_resolves(tmp_path, monkeypatch): from hermes_cli.auth import is_provider_explicitly_configured assert is_provider_explicitly_configured("deepseek") is True + + +def test_provider_not_in_registry_but_in_models_dev(tmp_path, monkeypatch): + """Providers absent from PROVIDER_REGISTRY but present in the models.dev + catalog (e.g. openrouter) must still be detected via their env vars. + + Regression: is_provider_explicitly_configured() only checked + PROVIDER_REGISTRY for env-var names, so providers that exist solely in + the models.dev catalog were never recognised as explicitly configured - + hiding them from the desktop model picker even when their API key was + set in .env. + """ + monkeypatch.setenv("HERMES_HOME", str(tmp_path / "hermes")) + monkeypatch.setenv("OPENROUTER_API_KEY", "sk-or-test-key-12345678") + monkeypatch.delenv("CLAUDE_CODE_OAUTH_TOKEN", raising=False) + (tmp_path / "hermes").mkdir(parents=True, exist_ok=True) + + from hermes_cli.auth import is_provider_explicitly_configured + assert is_provider_explicitly_configured("openrouter") is True