fix(auth): stop silently falling back to OpenRouter when no provider is configured (#3862)

Previously, when no API keys or provider credentials were found, Hermes
silently defaulted to OpenRouter + Claude Opus. This caused confusion
when users configured local servers (LM Studio, Ollama, etc.) with a
typo or unrecognized provider name — the system would silently route to
OpenRouter instead of telling them something was wrong.

Changes:
- resolve_provider() now raises AuthError when no credentials are found
  instead of returning 'openrouter' as a silent fallback
- Added local server aliases: lmstudio, ollama, vllm, llamacpp → custom
- Removed hardcoded 'anthropic/claude-opus-4.6' fallback from gateway
  and cron scheduler (they read from config.yaml instead)
- Updated cli-config.yaml.example with complete provider documentation
  including all supported providers, aliases, and local server setup
This commit is contained in:
Teknium
2026-03-29 21:06:35 -07:00
committed by GitHub
parent 3cc50532d1
commit 86ac23c8da
6 changed files with 44 additions and 19 deletions

View File

@@ -266,7 +266,8 @@ class TestResolveProvider:
def test_auto_does_not_select_copilot_from_github_token(self, monkeypatch):
monkeypatch.setenv("GITHUB_TOKEN", "gh-test-token")
assert resolve_provider("auto") == "openrouter"
with pytest.raises(AuthError, match="No inference provider configured"):
resolve_provider("auto")
# =============================================================================