mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-04 13:40:30 +00:00
fix: gpt-5.5+ in combination with azure fails with reasoningEffort (#40265)
This commit is contained in:
parent
9535a8f929
commit
87481f2bb6
2 changed files with 18 additions and 2 deletions
|
|
@ -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", () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue