mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-04 11:39:52 +00:00
fix(provider): gate Azure reasoning effort by endpoint
This commit is contained in:
parent
89130db6b0
commit
95136042c7
3 changed files with 7 additions and 10 deletions
|
|
@ -1270,11 +1270,6 @@ 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"
|
||||
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"
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ export const prepare = Effect.fn("LLMRequestPrep.prepare")(function* (input: Pre
|
|||
input.model.api.npm === "@ai-sdk/azure" &&
|
||||
(input.provider.options.useCompletionUrls || input.model.options.useCompletionUrls || options.useCompletionUrls)
|
||||
) {
|
||||
delete options.reasoningEffort
|
||||
delete options.reasoningSummary
|
||||
delete options.include
|
||||
}
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ describe("ProviderTransform.options - setCacheKey", () => {
|
|||
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({
|
||||
model: {
|
||||
...mockModel,
|
||||
|
|
@ -525,7 +525,7 @@ describe("ProviderTransform.options - gpt-5 textVerbosity", () => {
|
|||
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 = {
|
||||
...createGpt5Model("gpt-5.4"),
|
||||
id: "azure/gpt-5.4",
|
||||
|
|
@ -580,7 +580,7 @@ describe("ProviderTransform.options - gpt-5 textVerbosity", () => {
|
|||
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.include).toBeUndefined()
|
||||
expect(result.tools.lookup.strict).toBe(false)
|
||||
|
|
@ -681,14 +681,15 @@ describe("ProviderTransform.options - gpt-5 reasoningEffort", () => {
|
|||
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({
|
||||
model: createModel("gpt-5.5"),
|
||||
sessionID,
|
||||
providerOptions: {},
|
||||
})
|
||||
|
||||
expect(result.reasoningEffort).toBeUndefined()
|
||||
expect(result.reasoningEffort).toBe("medium")
|
||||
expect(result.reasoningSummary).toBe("auto")
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue