fix(microsoft-foundry): DeepSeek V4 models incorrectly use openai-completions API (#85549)

When onboarding Microsoft Foundry-hosted DeepSeek-V4 models (Pro/Flash),
the onboarding wizard assigned api: 'openai-completions' because
usesFoundryResponsesByDefault() only matched GPT/o-series models.

These V4 models require the Responses API (openai-responses) to work
correctly against the Foundry endpoint. Without this fix, all calls fail
with 'provider rejected the request schema or tool payload'.

Fix: Add 'deepseek-v4' prefix to usesFoundryResponsesByDefault() so only
the verified V4 family defaults to openai-responses. Older DeepSeek
families (e.g., V3) remain on openai-completions until proven compatible.

Closes: DeepSeek V4 models deployed via Microsoft Foundry onboarding
failing immediately due to wrong API adapter.

Co-authored-by: Roslin <rmj010203@gmail.com>
This commit is contained in:
Roslin Mahmud Joy
2026-05-23 17:49:53 +03:00
committed by GitHub
parent 74e65f4d85
commit ec43acb432
2 changed files with 3 additions and 0 deletions

View File

@@ -559,6 +559,8 @@ describe("microsoft-foundry plugin", () => {
expect(usesFoundryResponsesByDefault("gpt-5.4")).toBe(true);
expect(usesFoundryResponsesByDefault("gpt-5.2-codex")).toBe(true);
expect(usesFoundryResponsesByDefault("o4-mini")).toBe(true);
expect(usesFoundryResponsesByDefault("DeepSeek-V4-Pro")).toBe(true);
expect(usesFoundryResponsesByDefault("DeepSeek-V4-Flash")).toBe(true);
expect(usesFoundryResponsesByDefault("MAI-DS-R1")).toBe(false);
expect(requiresFoundryMaxCompletionTokens("gpt-5.4")).toBe(true);
expect(requiresFoundryMaxCompletionTokens("o3")).toBe(true);

View File

@@ -121,6 +121,7 @@ export function usesFoundryResponsesByDefault(value?: string | null): boolean {
normalized.startsWith("o1") ||
normalized.startsWith("o3") ||
normalized.startsWith("o4") ||
normalized.startsWith("deepseek-v4") ||
normalized === "computer-use-preview"
);
}