fix(model-picker): stop routing OpenAI selection to OpenRouter - #37175
Merged
Conversation
The /model picker emitted a standalone slug=openai row (gated on
OPENAI_API_KEY). Selecting it ran resolve_provider_full("openai"),
which resolved the legacy providers.py alias openai->openrouter BEFORE
checking the user's own providers.openai config — silently switching
users onto OpenRouter (HTTP 401 when they have no OR key).
- model_switch.list_authenticated_providers: skip vendor names that are
aliases to an aggregator (isolates openai->openrouter; copilot/kimi/etc.
are real providers and unaffected). Kills the phantom picker row.
- providers.resolve_provider_full: user-config providers.<name> now wins
over the built-in alias table, so providers.openai (api.openai.com)
beats the alias.
- model_switch PATH A: user-config providers resolve credentials via
their own endpoint instead of the name-based runtime resolver that
doesn't know user-config slugs; plus a fail-loud guard for explicit
unauthed-aggregator hops.
Verified E2E with the reporter's config (no OR key): selecting OpenAI +
gpt-4o-mini now resolves to api.openai.com instead of openrouter.ai.
Contributor
🔎 Lint report:
|
1 task
changman
pushed a commit
to changman/hermes-agent
that referenced
this pull request
Jun 10, 2026
…esearch#37175) The /model picker emitted a standalone slug=openai row (gated on OPENAI_API_KEY). Selecting it ran resolve_provider_full("openai"), which resolved the legacy providers.py alias openai->openrouter BEFORE checking the user's own providers.openai config — silently switching users onto OpenRouter (HTTP 401 when they have no OR key). - model_switch.list_authenticated_providers: skip vendor names that are aliases to an aggregator (isolates openai->openrouter; copilot/kimi/etc. are real providers and unaffected). Kills the phantom picker row. - providers.resolve_provider_full: user-config providers.<name> now wins over the built-in alias table, so providers.openai (api.openai.com) beats the alias. - model_switch PATH A: user-config providers resolve credentials via their own endpoint instead of the name-based runtime resolver that doesn't know user-config slugs; plus a fail-loud guard for explicit unauthed-aggregator hops. Verified E2E with the reporter's config (no OR key): selecting OpenAI + gpt-4o-mini now resolves to api.openai.com instead of openrouter.ai.
alt-glitch
pushed a commit
that referenced
this pull request
Jun 14, 2026
The /model picker emitted a standalone slug=openai row (gated on
OPENAI_API_KEY). Selecting it ran resolve_provider_full("openai"),
which resolved the legacy providers.py alias openai->openrouter BEFORE
checking the user's own providers.openai config — silently switching
users onto OpenRouter (HTTP 401 when they have no OR key).
- model_switch.list_authenticated_providers: skip vendor names that are
aliases to an aggregator (isolates openai->openrouter; copilot/kimi/etc.
are real providers and unaffected). Kills the phantom picker row.
- providers.resolve_provider_full: user-config providers.<name> now wins
over the built-in alias table, so providers.openai (api.openai.com)
beats the alias.
- model_switch PATH A: user-config providers resolve credentials via
their own endpoint instead of the name-based runtime resolver that
doesn't know user-config slugs; plus a fail-loud guard for explicit
unauthed-aggregator hops.
Verified E2E with the reporter's config (no OR key): selecting OpenAI +
gpt-4o-mini now resolves to api.openai.com instead of openrouter.ai.
kossteg
pushed a commit
to kossteg/hermes-agent
that referenced
this pull request
Jun 16, 2026
…esearch#37175) The /model picker emitted a standalone slug=openai row (gated on OPENAI_API_KEY). Selecting it ran resolve_provider_full("openai"), which resolved the legacy providers.py alias openai->openrouter BEFORE checking the user's own providers.openai config — silently switching users onto OpenRouter (HTTP 401 when they have no OR key). - model_switch.list_authenticated_providers: skip vendor names that are aliases to an aggregator (isolates openai->openrouter; copilot/kimi/etc. are real providers and unaffected). Kills the phantom picker row. - providers.resolve_provider_full: user-config providers.<name> now wins over the built-in alias table, so providers.openai (api.openai.com) beats the alias. - model_switch PATH A: user-config providers resolve credentials via their own endpoint instead of the name-based runtime resolver that doesn't know user-config slugs; plus a fail-loud guard for explicit unauthed-aggregator hops. Verified E2E with the reporter's config (no OR key): selecting OpenAI + gpt-4o-mini now resolves to api.openai.com instead of openrouter.ai.
T02200059
pushed a commit
to T02200059/hermes-agent
that referenced
this pull request
Jun 18, 2026
…esearch#37175) The /model picker emitted a standalone slug=openai row (gated on OPENAI_API_KEY). Selecting it ran resolve_provider_full("openai"), which resolved the legacy providers.py alias openai->openrouter BEFORE checking the user's own providers.openai config — silently switching users onto OpenRouter (HTTP 401 when they have no OR key). - model_switch.list_authenticated_providers: skip vendor names that are aliases to an aggregator (isolates openai->openrouter; copilot/kimi/etc. are real providers and unaffected). Kills the phantom picker row. - providers.resolve_provider_full: user-config providers.<name> now wins over the built-in alias table, so providers.openai (api.openai.com) beats the alias. - model_switch PATH A: user-config providers resolve credentials via their own endpoint instead of the name-based runtime resolver that doesn't know user-config slugs; plus a fail-loud guard for explicit unauthed-aggregator hops. Verified E2E with the reporter's config (no OR key): selecting OpenAI + gpt-4o-mini now resolves to api.openai.com instead of openrouter.ai.
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…esearch#37175) The /model picker emitted a standalone slug=openai row (gated on OPENAI_API_KEY). Selecting it ran resolve_provider_full("openai"), which resolved the legacy providers.py alias openai->openrouter BEFORE checking the user's own providers.openai config — silently switching users onto OpenRouter (HTTP 401 when they have no OR key). - model_switch.list_authenticated_providers: skip vendor names that are aliases to an aggregator (isolates openai->openrouter; copilot/kimi/etc. are real providers and unaffected). Kills the phantom picker row. - providers.resolve_provider_full: user-config providers.<name> now wins over the built-in alias table, so providers.openai (api.openai.com) beats the alias. - model_switch PATH A: user-config providers resolve credentials via their own endpoint instead of the name-based runtime resolver that doesn't know user-config slugs; plus a fail-loud guard for explicit unauthed-aggregator hops. Verified E2E with the reporter's config (no OR key): selecting OpenAI + gpt-4o-mini now resolves to api.openai.com instead of openrouter.ai.
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
…esearch#37175) The /model picker emitted a standalone slug=openai row (gated on OPENAI_API_KEY). Selecting it ran resolve_provider_full("openai"), which resolved the legacy providers.py alias openai->openrouter BEFORE checking the user's own providers.openai config — silently switching users onto OpenRouter (HTTP 401 when they have no OR key). - model_switch.list_authenticated_providers: skip vendor names that are aliases to an aggregator (isolates openai->openrouter; copilot/kimi/etc. are real providers and unaffected). Kills the phantom picker row. - providers.resolve_provider_full: user-config providers.<name> now wins over the built-in alias table, so providers.openai (api.openai.com) beats the alias. - model_switch PATH A: user-config providers resolve credentials via their own endpoint instead of the name-based runtime resolver that doesn't know user-config slugs; plus a fail-loud guard for explicit unauthed-aggregator hops. Verified E2E with the reporter's config (no OR key): selecting OpenAI + gpt-4o-mini now resolves to api.openai.com instead of openrouter.ai.
donbowman
pushed a commit
to donbowman/hermes-agent
that referenced
this pull request
Jul 13, 2026
…esearch#37175) The /model picker emitted a standalone slug=openai row (gated on OPENAI_API_KEY). Selecting it ran resolve_provider_full("openai"), which resolved the legacy providers.py alias openai->openrouter BEFORE checking the user's own providers.openai config — silently switching users onto OpenRouter (HTTP 401 when they have no OR key). - model_switch.list_authenticated_providers: skip vendor names that are aliases to an aggregator (isolates openai->openrouter; copilot/kimi/etc. are real providers and unaffected). Kills the phantom picker row. - providers.resolve_provider_full: user-config providers.<name> now wins over the built-in alias table, so providers.openai (api.openai.com) beats the alias. - model_switch PATH A: user-config providers resolve credentials via their own endpoint instead of the name-based runtime resolver that doesn't know user-config slugs; plus a fail-loud guard for explicit unauthed-aggregator hops. Verified E2E with the reporter's config (no OR key): selecting OpenAI + gpt-4o-mini now resolves to api.openai.com instead of openrouter.ai.
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…esearch#37175) The /model picker emitted a standalone slug=openai row (gated on OPENAI_API_KEY). Selecting it ran resolve_provider_full("openai"), which resolved the legacy providers.py alias openai->openrouter BEFORE checking the user's own providers.openai config — silently switching users onto OpenRouter (HTTP 401 when they have no OR key). - model_switch.list_authenticated_providers: skip vendor names that are aliases to an aggregator (isolates openai->openrouter; copilot/kimi/etc. are real providers and unaffected). Kills the phantom picker row. - providers.resolve_provider_full: user-config providers.<name> now wins over the built-in alias table, so providers.openai (api.openai.com) beats the alias. - model_switch PATH A: user-config providers resolve credentials via their own endpoint instead of the name-based runtime resolver that doesn't know user-config slugs; plus a fail-loud guard for explicit unauthed-aggregator hops. Verified E2E with the reporter's config (no OR key): selecting OpenAI + gpt-4o-mini now resolves to api.openai.com instead of openrouter.ai.
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
…esearch#37175) The /model picker emitted a standalone slug=openai row (gated on OPENAI_API_KEY). Selecting it ran resolve_provider_full("openai"), which resolved the legacy providers.py alias openai->openrouter BEFORE checking the user's own providers.openai config — silently switching users onto OpenRouter (HTTP 401 when they have no OR key). - model_switch.list_authenticated_providers: skip vendor names that are aliases to an aggregator (isolates openai->openrouter; copilot/kimi/etc. are real providers and unaffected). Kills the phantom picker row. - providers.resolve_provider_full: user-config providers.<name> now wins over the built-in alias table, so providers.openai (api.openai.com) beats the alias. - model_switch PATH A: user-config providers resolve credentials via their own endpoint instead of the name-based runtime resolver that doesn't know user-config slugs; plus a fail-loud guard for explicit unauthed-aggregator hops. Verified E2E with the reporter's config (no OR key): selecting OpenAI + gpt-4o-mini now resolves to api.openai.com instead of openrouter.ai.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
/modelpicker no longer silently routes an OpenAI selection to OpenRouter. Users with a configured OpenAI provider (and no OpenRouter key) now stay onapi.openai.cominstead of hitting HTTP 401 "Missing Authentication header."Root cause:
hermes_cli/providers.pycarries a legacy alias"openai" → "openrouter". The picker emitted a standaloneslug="openai"row (gated onOPENAI_API_KEY); selecting it ranresolve_provider_full("openai"), which resolved that built-in alias to OpenRouter before checking the user's ownproviders.openaiconfig.Changes
model_switch.list_authenticated_providers: skip vendor names that are aliases to an aggregator (isolates exactlyopenai→openrouter;copilot/kimi/etc. are real providers and unaffected). Kills the phantom picker row.providers.resolve_provider_full: user-configproviders.<name>now resolves before the built-in alias table, soproviders.openai(api.openai.com) beats the legacy alias.model_switchPATH A: user-config providers resolve credentials via their own endpoint instead of the name-based runtime resolver that doesn't know user-config slugs; plus a fail-loud guard for explicit unauthed-aggregator hops.Validation
target=openrouterbase=openrouter.ai → 401target=openaibase=api.openai.com ✓--provider openai-apiTargeted suites green (model_switch / providers / inventory / runtime / auth — 384 + 224 + 295 passing). Added 3 regression tests; converted 1 test that codified the phantom-row behavior.
Scope
Independent of #35056 (which doesn't touch the picker) and #24234 (separate encrypted-content 400). Does not change the
OPENAI_API_KEY-implies-openrouter overlay (issue #6799) — that's a wider resolution-semantics change #35056 rewrites; the reported symptom is fixed without it.Related issues: #14057 (duplicate OpenAI/openai picker rows), #19858 (model switcher hops to OpenRouter).
Infographic