Skip to content

fix(azure): detect modern services.ai.azure.com URLs in _is_azure_openai_url()#47668

Open
tcconnally wants to merge 2 commits into
NousResearch:mainfrom
Perseus-Computing-LLC:fix/azure-openai-url-detection-47666
Open

fix(azure): detect modern services.ai.azure.com URLs in _is_azure_openai_url()#47668
tcconnally wants to merge 2 commits into
NousResearch:mainfrom
Perseus-Computing-LLC:fix/azure-openai-url-detection-47666

Conversation

@tcconnally

Copy link
Copy Markdown

Summary

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).

Changes

  • run_agent.py: Extend _is_azure_openai_url() to also match ai.azure.com in URLs (in addition to openai.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

pytest tests/run_agent/test_run_agent.py::TestGpt5ApiModeRouting::test_is_azure_openai_url_detection -xvs
# 1 passed

Closes #47666

…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
@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint provider/openai OpenAI / Codex Responses API P2 Medium — degraded but workaround exists labels Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists provider/openai OpenAI / Codex Responses API type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: _is_azure_openai_url() doesn't detect modern services.ai.azure.com URLs

2 participants