fix(provider): gate Azure reasoning effort by endpoint

This commit is contained in:
Aiden Cline 2026-08-03 19:05:48 +00:00 committed by Luke Parker
commit 95136042c7
3 changed files with 7 additions and 10 deletions

View file

@ -1270,11 +1270,6 @@ export function options(input: {
result["gateway"] = { caching: "auto" } result["gateway"] = { caching: "auto" }
} }
if (input.model.api.npm === "@ai-sdk/azure" && input.model.api.id.includes("gpt-5.5")) {
result["reasoningSummary"] = "auto"
return result
}
if (input.model.api.id.includes("gpt-5") && !input.model.api.id.includes("gpt-5-chat")) { if (input.model.api.id.includes("gpt-5") && !input.model.api.id.includes("gpt-5-chat")) {
if (!input.model.api.id.includes("gpt-5-pro")) { if (!input.model.api.id.includes("gpt-5-pro")) {
result["reasoningEffort"] = "medium" result["reasoningEffort"] = "medium"

View file

@ -93,6 +93,7 @@ export const prepare = Effect.fn("LLMRequestPrep.prepare")(function* (input: Pre
input.model.api.npm === "@ai-sdk/azure" && input.model.api.npm === "@ai-sdk/azure" &&
(input.provider.options.useCompletionUrls || input.model.options.useCompletionUrls || options.useCompletionUrls) (input.provider.options.useCompletionUrls || input.model.options.useCompletionUrls || options.useCompletionUrls)
) { ) {
delete options.reasoningEffort
delete options.reasoningSummary delete options.reasoningSummary
delete options.include delete options.include
} }

View file

@ -252,7 +252,7 @@ describe("ProviderTransform.options - setCacheKey", () => {
expect(result.promptCacheKey).toBeUndefined() expect(result.promptCacheKey).toBeUndefined()
}) })
test("should keep the Azure cache key for gpt-5.5 early return", () => { test("should keep the Azure cache key for gpt-5.5 Responses defaults", () => {
const result = ProviderTransform.options({ const result = ProviderTransform.options({
model: { model: {
...mockModel, ...mockModel,
@ -525,7 +525,7 @@ describe("ProviderTransform.options - gpt-5 textVerbosity", () => {
expect(result.include).toBeUndefined() expect(result.include).toBeUndefined()
}) })
test("azure chat completions omit Responses-only reasoning options after variants merge", async () => { test("azure chat completions omit unsupported reasoning options after variants merge", async () => {
const model = { const model = {
...createGpt5Model("gpt-5.4"), ...createGpt5Model("gpt-5.4"),
id: "azure/gpt-5.4", id: "azure/gpt-5.4",
@ -580,7 +580,7 @@ describe("ProviderTransform.options - gpt-5 textVerbosity", () => {
isWorkflow: false, isWorkflow: false,
}), }),
) )
expect(result.params.options.reasoningEffort).toBe("high") expect(result.params.options.reasoningEffort).toBeUndefined()
expect(result.params.options.reasoningSummary).toBeUndefined() expect(result.params.options.reasoningSummary).toBeUndefined()
expect(result.params.options.include).toBeUndefined() expect(result.params.options.include).toBeUndefined()
expect(result.tools.lookup.strict).toBe(false) expect(result.tools.lookup.strict).toBe(false)
@ -681,14 +681,15 @@ describe("ProviderTransform.options - gpt-5 reasoningEffort", () => {
expect(result.reasoningEffort).toBeUndefined() expect(result.reasoningEffort).toBeUndefined()
}) })
test("gpt-5.5 should NOT set reasoningEffort", () => { test("gpt-5.5 should set Responses reasoning options", () => {
const result = ProviderTransform.options({ const result = ProviderTransform.options({
model: createModel("gpt-5.5"), model: createModel("gpt-5.5"),
sessionID, sessionID,
providerOptions: {}, providerOptions: {},
}) })
expect(result.reasoningEffort).toBeUndefined() expect(result.reasoningEffort).toBe("medium")
expect(result.reasoningSummary).toBe("auto")
}) })
}) })