fix(azure): detect modern services.ai.azure.com URLs in _is_azure_openai_url()#47668
Open
tcconnally wants to merge 2 commits into
Open
fix(azure): detect modern services.ai.azure.com URLs in _is_azure_openai_url()#47668tcconnally wants to merge 2 commits into
tcconnally wants to merge 2 commits into
Conversation
…nai_url() Azure OpenAI resources created after 2024 use the *.services.ai.azure.com URL pattern instead of the legacy *.openai.azure.com pattern. The _is_azure_openai_url() check only matched the legacy pattern, causing Hermes to route Azure requests through the standard OpenAI path, which fails on models served without the /v1/ prefix (e.g. gpt-5.x). Extend the URL check to also match 'ai.azure.com', covering both legacy and modern Azure OpenAI endpoints. Closes NousResearch#47666
This was referenced Jun 17, 2026
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
Azure OpenAI resources created after 2024 use the
*.services.ai.azure.comURL pattern instead of the legacy*.openai.azure.compattern. The_is_azure_openai_url()check only matched the legacy pattern, causing Hermes to route Azure requests through the standard OpenAI path, which fails on models served without the/v1/prefix (e.g. gpt-5.x).Changes
run_agent.py: Extend_is_azure_openai_url()to also matchai.azure.comin URLs (in addition toopenai.azure.com)tests/run_agent/test_run_agent.py: Add test cases for modern Azure URL patterns (services.ai.azure.com,api.ai.azure.com)Testing
Closes #47666