Skip to content

Support Responses API in Azure BYOK#322845

Merged
vijayupadya merged 2 commits into
mainfrom
gleaming-thrush
Jun 24, 2026
Merged

Support Responses API in Azure BYOK#322845
vijayupadya merged 2 commits into
mainfrom
gleaming-thrush

Conversation

@vijayupadya

@vijayupadya vijayupadya commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Fixes #318114

When using an Azure BYOK model with Entra auth and a Responses API URL (e.g. behind APIM), VS Code was sending
Chat Completions request bodies (messages) instead of Responses bodies (input), which Azure rejects with:

Unsupported parameter: 'messages'. In the Responses API, this parameter has moved to 'input'.

Cause

The Entra auth path in azureProvider.ts builds its modelInfo manually and never set supported_endpoints, so the endpoint defaulted to Chat
Completions. The API-key path already marked Responses URLs correctly.

Fix

Extracted a small testable helper azureSupportedEndpointsForUrl(url) that returns [ChatCompletions, Responses] for /responses URLs (including APIM vanity domains) and undefined otherwise. The Entra path now applies it to modelInfo.supported_endpoints, mirroring the existing API-key behavior.

Copilot AI review requested due to automatic review settings June 24, 2026 23:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Azure BYOK (Bring Your Own Key) Entra-authenticated request shaping when users configure an explicit Responses API URL (including APIM vanity domains). It adds a small helper to detect Responses URLs and ensures the Entra auth path sets modelInfo.supported_endpoints so the request body uses input (Responses) instead of messages (Chat Completions).

Changes:

  • Add azureSupportedEndpointsForUrl(url) to detect /responses URLs and advertise Responses support via supported_endpoints.
  • Apply the helper in the Azure Entra auth path so request bodies are shaped for the Responses API when appropriate.
  • Add unit tests covering APIM /responses URL preservation and supported-endpoints detection.
Show a summary per file
File Description
extensions/copilot/src/extension/byok/vscode-node/azureProvider.ts Adds azureSupportedEndpointsForUrl and uses it in the Entra auth flow to set modelInfo.supported_endpoints for Responses API URLs.
extensions/copilot/src/extension/byok/vscode-node/test/azureProvider.spec.ts Adds tests for APIM /responses URL preservation and for supported-endpoints detection behavior.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment thread extensions/copilot/src/extension/byok/vscode-node/azureProvider.ts
@vijayupadya vijayupadya marked this pull request as ready for review June 24, 2026 23:39
@vijayupadya vijayupadya enabled auto-merge (squash) June 24, 2026 23:39
@vijayupadya vijayupadya merged commit 9b0c342 into main Jun 24, 2026
28 checks passed
@vijayupadya vijayupadya deleted the gleaming-thrush branch June 24, 2026 23:49
@vs-code-engineering vs-code-engineering Bot added this to the 1.127.0 milestone Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Azure BYOK Entra Path Should Mark Responses API Endpoints Correctly

3 participants