fix(auth): resolve bare "openai" slug to "openai-api" provider#37714
Open
rodboev wants to merge 1 commit into
Open
fix(auth): resolve bare "openai" slug to "openai-api" provider#37714rodboev wants to merge 1 commit into
rodboev wants to merge 1 commit into
Conversation
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
resolve_provider("openai")raisesAuthError: Unknown provider 'openai'even thoughopenai-apiis a registered provider andmodels.pyalready groups both slugs under the"openai"display key (line 993). Consumers that send the bare slug — WebUI model picker, config.yamlmodel.provider, CLI--providerflag — get a confusing error instead of routing toopenai-api.The alias tables in
auth.pyandmodels.pyhad entries for every other provider group ("claude": "anthropic","google": "gemini","grok": "xai") but not"openai". This surfaced during nesquena/hermes-webui#3444 where the WebUI picker collapsedopenai-apitoopenaifor display and the send path broke because the agent registry has noopenaikey.Changes
hermes_cli/auth.py: add"openai": "openai-api"to_PROVIDER_ALIASESinresolve_provider()(+1)hermes_cli/models.py: same entry in the models-layer_PROVIDER_ALIASES(+1)tests/hermes_cli/test_openai_provider_alias.py: new file, 7 tests covering resolve, case insensitivity, canonical passthrough, codex independence, registry presence, and themodels.pyalias (+39)Validation
resolve_provider("openai")AuthError: Unknown provider 'openai'"openai-api"resolve_provider("OpenAI")"openai-api"(case-insensitive)resolve_provider("openai-api")"openai-api""openai-api"(unchanged)resolve_provider("openai-codex")"openai-codex""openai-codex"(unchanged)Test plan
pytest tests/hermes_cli/test_openai_provider_alias.py -v— 7 passedpytest tests/hermes_cli/test_api_key_providers.py -v— 165 passed (regression check)