Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions packages/opencode/src/provider/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,15 @@ export function variants(model: Provider.Model): Record<string, Record<string, a
}
const adaptiveThinkingOmitted = anthropicOmitsThinking(model.api.id)
const adaptiveEfforts = anthropicAdaptiveEfforts(model.api.id)
// GLM-5.2 exposes two meaningful thinking-effort levels (high and max).
// Older GLM models only had a binary toggle, so they fall through to the
// blanket exclusion below. See: https://docs.z.ai/devpack/latest-model
if (id.includes("glm-5.2")) {
return {
high: { reasoningEffort: "high" },
max: { reasoningEffort: "max" },
}
}
if (
id.includes("deepseek-chat") ||
id.includes("deepseek-reasoner") ||
Expand Down
18 changes: 18 additions & 0 deletions packages/opencode/test/provider/transform.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2694,6 +2694,24 @@ describe("ProviderTransform.variants", () => {
expect(result).toEqual({})
})

test("glm-5.2 returns high and max effort variants", () => {
const model = createMockModel({
id: "zhipuai/glm-5.2",
providerID: "zhipuai",
api: {
id: "glm-5.2",
url: "https://api.z.ai/api/coding/paas/v4",
npm: "@ai-sdk/openai-compatible",
},
capabilities: { reasoning: true },
})
const result = ProviderTransform.variants(model)
expect(result).toEqual({
high: { reasoningEffort: "high" },
max: { reasoningEffort: "max" },
})
})

test("mistral models with reasoning support return variants", () => {
const model = createMockModel({
id: "mistral/mistral-small-latest",
Expand Down
Loading