Skip to content

Commit 0d8e706

Browse files
committed
test: fix transfomr test
1 parent d841e70 commit 0d8e706

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

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

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ describe("ProviderTransform.variants", () => {
11401140
expect(Object.keys(result)).toEqual(["none", "minimal", "low", "medium", "high", "xhigh"])
11411141
})
11421142

1143-
test("grok-4 returns OPENAI_EFFORTS with reasoning", () => {
1143+
test("grok-4 returns empty object", () => {
11441144
const model = createMockModel({
11451145
id: "openrouter/grok-4",
11461146
providerID: "openrouter",
@@ -1151,7 +1151,23 @@ describe("ProviderTransform.variants", () => {
11511151
},
11521152
})
11531153
const result = ProviderTransform.variants(model)
1154-
expect(Object.keys(result)).toEqual(["none", "minimal", "low", "medium", "high", "xhigh"])
1154+
expect(result).toEqual({})
1155+
})
1156+
1157+
test("grok-3-mini returns low and high with reasoning", () => {
1158+
const model = createMockModel({
1159+
id: "openrouter/grok-3-mini",
1160+
providerID: "openrouter",
1161+
api: {
1162+
id: "grok-3-mini",
1163+
url: "https://openrouter.ai",
1164+
npm: "@openrouter/ai-sdk-provider",
1165+
},
1166+
})
1167+
const result = ProviderTransform.variants(model)
1168+
expect(Object.keys(result)).toEqual(["low", "high"])
1169+
expect(result.low).toEqual({ reasoning: { effort: "low" } })
1170+
expect(result.high).toEqual({ reasoning: { effort: "high" } })
11551171
})
11561172
})
11571173

@@ -1210,7 +1226,7 @@ describe("ProviderTransform.variants", () => {
12101226
})
12111227

12121228
describe("@ai-sdk/xai", () => {
1213-
test("returns WIDELY_SUPPORTED_EFFORTS with reasoningEffort", () => {
1229+
test("grok-3 returns empty object", () => {
12141230
const model = createMockModel({
12151231
id: "xai/grok-3",
12161232
providerID: "xai",
@@ -1221,7 +1237,21 @@ describe("ProviderTransform.variants", () => {
12211237
},
12221238
})
12231239
const result = ProviderTransform.variants(model)
1224-
expect(Object.keys(result)).toEqual(["low", "medium", "high"])
1240+
expect(result).toEqual({})
1241+
})
1242+
1243+
test("grok-3-mini returns low and high with reasoningEffort", () => {
1244+
const model = createMockModel({
1245+
id: "xai/grok-3-mini",
1246+
providerID: "xai",
1247+
api: {
1248+
id: "grok-3-mini",
1249+
url: "https://api.x.ai",
1250+
npm: "@ai-sdk/xai",
1251+
},
1252+
})
1253+
const result = ProviderTransform.variants(model)
1254+
expect(Object.keys(result)).toEqual(["low", "high"])
12251255
expect(result.low).toEqual({ reasoningEffort: "low" })
12261256
expect(result.high).toEqual({ reasoningEffort: "high" })
12271257
})

0 commit comments

Comments
 (0)