fix(microsoft-foundry): skip DeepSeek V4 thinking params on Foundry fallback

This commit is contained in:
Manolis Nikiforakis
2026-05-30 13:03:29 +03:00
parent 6804b7cb71
commit c950ac112e
2 changed files with 21 additions and 0 deletions

View File

@@ -733,6 +733,26 @@ describe("applyExtraParamsToAgent", () => {
expect(messages[2]).not.toHaveProperty("reasoning_content");
});
it("does not add DeepSeek V4 thinking params on the Foundry fallback path", () => {
const payload = runResponsesPayloadMutationCase({
applyProvider: "microsoft-foundry",
applyModelId: "deepseek-v4-pro",
thinkingLevel: "high",
model: {
api: "openai-completions",
provider: "microsoft-foundry",
id: "deepseek-v4-pro",
} as Model<"openai-completions">,
payload: {
reasoning_effort: "high",
messages: [{ role: "user", content: "hello" }],
},
});
expect(payload.reasoning_effort).toBe("high");
expect(payload).not.toHaveProperty("thinking");
});
it("fills MiMo V2.6 reasoning_content for unowned OpenAI-compatible proxy models", () => {
const payload = runResponsesPayloadMutationCase({
applyProvider: "opencode",

View File

@@ -901,6 +901,7 @@ function isDeepSeekV4OpenAICompatibleModel(model: Parameters<StreamFn>[0]): bool
const normalizedModelId = normalizeDeepSeekV4CandidateId(model.id);
return (
model.api === "openai-completions" &&
model.provider !== "microsoft-foundry" &&
(normalizedModelId === "deepseek-v4-flash" || normalizedModelId === "deepseek-v4-pro")
);
}