Skip to content

Commit 9991a33

Browse files
authored
fix(core): expose azure openai xhigh efforts (anomalyco#30620)
1 parent 11dbd15 commit 9991a33

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

‎packages/opencode/src/provider/transform.ts‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -782,10 +782,7 @@ export function variants(model: Provider.Model): Record<string, Record<string, a
782782
// https://v5.ai-sdk.dev/providers/ai-sdk-providers/azure
783783
if (id === "o1-mini") return {}
784784
return Object.fromEntries(
785-
(GPT5_FAMILY_RE.test(id) && gpt5Version(id) === undefined
786-
? ["minimal", ...WIDELY_SUPPORTED_EFFORTS]
787-
: WIDELY_SUPPORTED_EFFORTS
788-
).map((effort) => [
785+
openaiReasoningEfforts(id, model.release_date).map((effort) => [
789786
effort,
790787
{
791788
reasoningEffort: effort,

‎packages/opencode/test/provider/transform.test.ts‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3013,20 +3013,25 @@ describe("ProviderTransform.variants", () => {
30133013
expect(Object.keys(result)).toEqual(["minimal", "low", "medium", "high"])
30143014
})
30153015

3016-
for (const id of ["gpt-5-4", "gpt-5-5"]) {
3017-
test(`${id} does not add minimal effort`, () => {
3016+
for (const testCase of [
3017+
{ id: "gpt-5-1", efforts: ["none", "low", "medium", "high"] },
3018+
{ id: "gpt-5-4", efforts: ["none", "low", "medium", "high", "xhigh"] },
3019+
{ id: "gpt-5.4", efforts: ["none", "low", "medium", "high", "xhigh"] },
3020+
{ id: "gpt-5-5", efforts: ["none", "low", "medium", "high", "xhigh"] },
3021+
]) {
3022+
test(`${testCase.id} returns supported Azure reasoning efforts`, () => {
30183023
const result = ProviderTransform.variants(
30193024
createMockModel({
3020-
id,
3025+
id: testCase.id,
30213026
providerID: "azure",
30223027
api: {
3023-
id,
3028+
id: testCase.id,
30243029
url: "https://azure.com",
30253030
npm: "@ai-sdk/azure",
30263031
},
30273032
}),
30283033
)
3029-
expect(Object.keys(result)).toEqual(["low", "medium", "high"])
3034+
expect(Object.keys(result)).toEqual(testCase.efforts)
30303035
})
30313036
}
30323037
})

0 commit comments

Comments
 (0)