mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-21 20:04:27 +00:00
fix: bug encountered when using azure gpt-5.5 w/ completions api (#26222)
This commit is contained in:
@@ -1126,6 +1126,11 @@ export function options(input: {
|
||||
result["enable_thinking"] = true
|
||||
}
|
||||
|
||||
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-pro")) {
|
||||
result["reasoningEffort"] = "medium"
|
||||
|
||||
@@ -310,6 +310,75 @@ describe("ProviderTransform.options - gpt-5 textVerbosity", () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe("ProviderTransform.options - gpt-5 reasoningEffort", () => {
|
||||
const sessionID = "test-session-123"
|
||||
|
||||
const createModel = (apiId: string) =>
|
||||
({
|
||||
id: `azure/${apiId}`,
|
||||
providerID: "azure",
|
||||
api: {
|
||||
id: apiId,
|
||||
url: "https://azure.com",
|
||||
npm: "@ai-sdk/azure",
|
||||
},
|
||||
name: apiId,
|
||||
capabilities: {
|
||||
temperature: true,
|
||||
reasoning: true,
|
||||
attachment: true,
|
||||
toolcall: true,
|
||||
input: {
|
||||
text: true,
|
||||
audio: false,
|
||||
image: true,
|
||||
video: false,
|
||||
pdf: false,
|
||||
},
|
||||
output: {
|
||||
text: true,
|
||||
audio: false,
|
||||
image: false,
|
||||
video: false,
|
||||
pdf: false,
|
||||
},
|
||||
interleaved: false,
|
||||
},
|
||||
cost: {
|
||||
input: 0.03,
|
||||
output: 0.06,
|
||||
cache: { read: 0.001, write: 0.002 },
|
||||
},
|
||||
limit: {
|
||||
context: 128000,
|
||||
output: 4096,
|
||||
},
|
||||
status: "active",
|
||||
options: {},
|
||||
headers: {},
|
||||
}) as any
|
||||
|
||||
test('gpt-5-chat should NOT set reasoningEffort', () => {
|
||||
const result = ProviderTransform.options({
|
||||
model: createModel("gpt-5-chat"),
|
||||
sessionID,
|
||||
providerOptions: {},
|
||||
})
|
||||
|
||||
expect(result.reasoningEffort).toBeUndefined()
|
||||
})
|
||||
|
||||
test("gpt-5.5 should NOT set reasoningEffort", () => {
|
||||
const result = ProviderTransform.options({
|
||||
model: createModel("gpt-5.5"),
|
||||
sessionID,
|
||||
providerOptions: {},
|
||||
})
|
||||
|
||||
expect(result.reasoningEffort).toBeUndefined()
|
||||
})
|
||||
})
|
||||
|
||||
describe("ProviderTransform.options - gateway", () => {
|
||||
const sessionID = "test-session-123"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user