fix(auth): recognize the "openai" provider alias in resolve_provider - #29570
fix(auth): recognize the "openai" provider alias in resolve_provider#29570pmos69 wants to merge 1 commit into
Conversation
resolve_provider()'s _PROVIDER_ALIASES table did not include "openai", so a config or request with provider "openai" was rejected as "Unknown provider 'openai'" — even though providers.py's ALIASES table already maps "openai" to "openrouter". Add the alias here so both tables agree. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Thanks for identifying the resolver/catalog mismatch. The premise is confirmed on current main: Problems
Suggested changes
Automated hermes-sweeper review. |
GottZ
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Summary
Three PRs address the provider-alias resolution area: #29570 maps bare openai to the established openrouter target, #37714 instead maps it to openai-api across two resolver layers and adds focused tests, and #50129 synchronizes eleven unrelated aliases into resolve_provider() with regression coverage. Only #29570 matches the documented bare-openai contract and the reported resolver/catalog mismatch.
Related pull requests
- #29570
related— (+4/-0) — keep open, add regression coverage: the diff fixes the reported mismatch by mapping bareopenaitoopenrouter, consistent withproviders.pyand the existing model-switch contract; as its contributor review notes, it still needs a focusedresolve_provider("openai") == "openrouter"test. - #37714 [closed]
related— (+45/-0) — keep closed, conflicting semantics: the diff maps bareopenaitoopenai-apiin bothauth.pyandmodels.pyand addstests/hermes_cli/test_openai_provider_alias.pywith focused resolution, case, registry, and normalization tests, but this contradicts the establishedopenai → openroutercontract. Despite the keep_open review on #37714, its own blocking analysis requires a repo-wide provider-contract decision and end-to-end routing coverage; the later contributor closure also records that the cited picker symptom was already fixed by #37175, so this branch should not be reopened for the narrower issue. - #50129 [closed]
related— (+40/-0) — keep closed as a superseded related fix: the diff adds eleven non-OpenAI aliases toauth.pyplus resolver tests, addressing the same alias-table drift class but not the bare-openaicause. It remains relevant as evidence of systemic alias duplication, while the discussion records that main independently gained these aliases and dynamic provider extension.
Suggested consolidation
Merge #29570 after adding the focused regression assertion requested by its contributor review; it is the only candidate whose target preserves the documented bare-openai semantics. Keep #37714 closed because its tested openai-api mapping conflicts with that contract, and keep #50129 closed because its broader non-OpenAI alias synchronization is already present on main; neither should be closed as a literal duplicate of #29570.
Cross-PR triage: Reviewed 3 pull requests and 0 issues in this complex. Each diff was read against this issue; Assessment working set: 6 kB of PR diffs, 5 kB of issue/PR text, 4 kB of discussion (5 comments), 0 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.
Summary
resolve_provider()inhermes_cli/auth.pybuilds a_PROVIDER_ALIASEStable to normalize provider names, but it does not include"openai". A config or request withprovider: openaitherefore falls through to the "Unknown provider 'openai'" error path — even thoughhermes_cli/providers.py's module-levelALIASEStable already maps"openai" → "openrouter".The two alias tables disagree, and
resolve_provideris the one that gates the error.Fix
Add
"openai": "openrouter"to_PROVIDER_ALIASES, soresolve_provideragrees withproviders.py'sALIASESand a bareopenaiprovider resolves to the generic OpenAI-compatible runtime instead of being rejected.One line (plus a comment). Fully backwards compatible — it only adds a previously-unhandled alias.
Context
Surfaced by an API client that wrote
model.provider: openaiafter the user configured an OpenAI key; the gateway then refused to start withUnknown provider 'openai'.