Skip to content

fix(auth): preserve 'custom' provider instead of silently mapping to openrouter#2725

Closed
amethystani wants to merge 1 commit into
NousResearch:mainfrom
amethystani:fix/custom-provider-silently-switched
Closed

fix(auth): preserve 'custom' provider instead of silently mapping to openrouter#2725
amethystani wants to merge 1 commit into
NousResearch:mainfrom
amethystani:fix/custom-provider-silently-switched

Conversation

@amethystani

Copy link
Copy Markdown
Contributor

Summary

normalize_provider() in auth.py grouped 'custom' and 'openrouter' in a single set check and returned 'openrouter' for both. Users who set provider: custom in config.yaml would silently have their provider switched to openrouter mid-session with no warning, error message, or any indication that the switch happened.

Root Cause

hermes_cli/auth.py line 693:

# Before
if normalized in {"openrouter", "custom"}:
    return "openrouter"

Fix

Split the single set check into two explicit returns:

if normalized == "openrouter":
    return "openrouter"
if normalized == "custom":
    return "custom"

Impact

One-line surgical fix. Users who set provider: custom (local LLMs, custom OpenAI-compatible endpoints) will no longer have their provider silently overridden.

Closes #2562

…openrouter

normalize_provider() grouped 'custom' and 'openrouter' together and
returned 'openrouter' for both. Users who set provider: custom in
config.yaml would silently have their provider switched to openrouter
mid-session with no warning or error message.

Split the single set check into two explicit returns so that 'openrouter'
stays 'openrouter' and 'custom' stays 'custom'.
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #2792 which fixes #2562 comprehensively (auth.py + runtime_provider.py + no-key-required fallback for local servers + tests). Your fix attempt is appreciated — thank you for the contribution!

@teknium1 teknium1 closed this Mar 24, 2026
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]: 'custom' provider gets switched to 'openrouter'

2 participants