Fix Azure/OpenAI endpoints and reject Azure AI Inference URLs#5860
Fix Azure/OpenAI endpoints and reject Azure AI Inference URLs#5860kevinvandijk merged 2 commits intoKilo-Org:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 0e10528 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
f97b066 to
edfda0a
Compare
edfda0a to
8ec231b
Compare
|
Can confirm that this fix works with a Microsoft Foundry deployment of gpt-5.2-codex with Model version 2026-01-14 |
8ec231b to
5cc567c
Compare
5a074ce to
e4a736e
Compare
…odex and reject Azure AI Inference URLs Normalize Responses base URLs for Azure/OpenAI fallback paths. Use Azure auth/query behavior (api-key + api-version) for fallback requests. Add openai-responses config validation and targeted tests.
e4a736e to
baeb3f4
Compare
kevinvandijk
left a comment
There was a problem hiding this comment.
Thanks! Looks good to me
Code Review SummaryStatus: No Issues Found | Recommendation: Merge OverviewThis PR refactors Azure endpoint handling in the OpenAI Responses provider to:
The URL normalization logic in Test coverage is thorough — new tests cover Azure AI Inference rejection, Azure OpenAI SDK path options, Azure fallback auth headers, deployment URL normalization, cognitiveservices endpoint normalization, and validation for the Files Reviewed (5 files)
|
Context
The OpenAI Responses provider had endpoint-shape mismatches when users supplied Azure-style URLs, especially deployment/chat-completions paths. This caused fallback behavior to hit incorrect URLs and mixed auth/query behavior between OpenAI and Azure. We also needed to fail fast for unsupported Azure AI Inference endpoints (
*.services.ai.azure.com) and tighten config validation foropenai-responses.Implementation
/responseswithout duplicating or mis-shaping/v1.api-keyheader.Authorization: Bearer ....api-versionbehavior only when needed for non-/openai/v1paths./deployments/.../chat/completionsas a base URL.openai-responsesvalidation in webview settings (openAiBaseUrl,openAiApiKey,openAiModelIdrequired).How to Test
cd src && pnpm test api/providers/__tests__/openai-responses.spec.tscd webview-ui && pnpm test src/utils/__tests__/validate.spec.tsopenai-responseswith Azure OpenAI base URLhttps://<resource>.openai.azure.com/openai/v1and deployment model name; confirm requests target/openai/v1/responses.https://<resource>.services.ai.azure.com/...); confirm the provider fails immediately with the unsupported-endpoint error./openai/v1/responsescorrectly.Note
The Discord user who has brought it up tested this change.