mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-08 18:30:00 -04:00
fix: gpt-5.5+ in combination with azure fails with reasoningEffort (#40265)
This commit is contained in:
@@ -1270,8 +1270,14 @@ export function options(input: {
|
||||
result["gateway"] = { caching: "auto" }
|
||||
}
|
||||
|
||||
if (input.model.api.npm === "@ai-sdk/azure" && input.model.api.id.includes("gpt-5.5")) {
|
||||
result["reasoningSummary"] = "auto"
|
||||
// Any gpt version above 5.4 in combination with azure does not support reasoningEffort
|
||||
// so we should return early here.
|
||||
const [, gptMajorVersion, gptMinorVersion] = input.model.api.id.match(/gpt-(\d+)\.(\d+)/) ?? []
|
||||
const isGpt55OrNewer = Number(gptMajorVersion) > 5 || (Number(gptMajorVersion) === 5 && Number(gptMinorVersion) >= 5)
|
||||
if (input.model.api.npm === "@ai-sdk/azure" && input.providerOptions?.useCompletionUrls) {
|
||||
if (!isGpt55OrNewer) {
|
||||
result["reasoningEffort"] = "medium"
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
@@ -690,6 +690,16 @@ describe("ProviderTransform.options - gpt-5 reasoningEffort", () => {
|
||||
|
||||
expect(result.reasoningEffort).toBeUndefined()
|
||||
})
|
||||
|
||||
test("gpt-5.6 should NOT set reasoningEffort", () => {
|
||||
const result = ProviderTransform.options({
|
||||
model: createModel("gpt-5.6"),
|
||||
sessionID,
|
||||
providerOptions: {},
|
||||
})
|
||||
|
||||
expect(result.reasoningEffort).toBeUndefined()
|
||||
})
|
||||
})
|
||||
|
||||
describe("ProviderTransform.options - gateway", () => {
|
||||
|
||||
Reference in New Issue
Block a user