fix(agent): preserve custom codex provider aliases#17498
Closed
zhonghui5207 wants to merge 1 commit into
Closed
Conversation
f1466a4 to
f9aecc7
Compare
f9aecc7 to
6749a45
Compare
7 tasks
Contributor
|
This looks implemented on current main by a broader alias-shadowing fix. Automated hermes-sweeper review evidence:
Thanks for the original report and fix direction; the landed version moved the behavior into the shared provider-resolution path so other alias collisions inherit it too. |
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.
What does this PR do?
Fixes auxiliary provider resolution when a user-defined provider is named
codex.Before this change,
resolve_provider_client()normalized aliases before checking named custom providers:That meant a configured local/custom endpoint named
codexwas bypassed and Hermes tried to find OpenAI Codex OAuth credentials instead. This PR gives the raw requested provider name a chance to resolve againstproviders:/custom_providers:before the built-incodex -> openai-codexalias wins.The existing alias behavior is preserved when no custom provider named
codexexists.Related Issue
Fixes #17488
Type of Change
Changes Made
agent/auxiliary_client.pyresolve_provider_client().tests/agent/test_auxiliary_named_custom_providers.pycodex.custom:codex.codexstill resolves to built-inopenai-codexwhen no custom provider shadows it.How to Test
Configure a custom provider named
codex:Resolve an auxiliary client for
codex.Confirm it uses the configured custom endpoint instead of the built-in
openai-codexOAuth path.Automated checks run:
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
N/A.
Screenshots / Logs
N/A. This is provider-resolution logic covered by unit tests.