Skip to content

feat(opencode): expose High/Max thinking variants for GLM-5.2#32446

Merged
rekram1-node merged 4 commits into
anomalyco:devfrom
imranshaiedi-byte:glm-52-variants
Jun 20, 2026
Merged

feat(opencode): expose High/Max thinking variants for GLM-5.2#32446
rekram1-node merged 4 commits into
anomalyco:devfrom
imranshaiedi-byte:glm-52-variants

Conversation

@imranshaiedi-byte

@imranshaiedi-byte imranshaiedi-byte commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #32444
Related: #18598

Type of change

  • Bug fix

What does this PR do?

GLM-5.2 supports two thinking-effort levels (High and Max), but ProviderTransform.variants() in packages/opencode/src/provider/transform.ts returns {} for any model whose ID contains "glm". This blanket exclusion was added for older GLM models that only have a binary thinking toggle, but it also suppresses GLM-5.2 which is different — Z.AI docs confirm it exposes High and Max effort levels.

The fix carves out GLM-5.2 before the blanket exclusion so it returns high/max variants. Earlier GLM models (5.1, 5, 4.x) still hit the id.includes("glm") check and correctly get {} since they only support a thinking toggle.

Ref: https://docs.z.ai/devpack/latest-model

How did you verify your code works?

  • Ran bun typecheck in packages/opencode — passes clean
  • Ran oxlint on the edited file — 0 errors (4 pre-existing warnings in untouched code)
  • Confirmed GLM-5.2 returns { high: { reasoningEffort: "high" }, max: { reasoningEffort: "max" } } while GLM-5.1 and earlier still return {} via the existing exclusion

Screenshots / recordings

Non-UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. and removed needs:compliance This means the issue will auto-close after 2 hours. labels Jun 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@rekram1-node rekram1-node changed the title fix(opencode): expose High/Max thinking variants for GLM-5.2 feat(opencode): expose High/Max thinking variants for GLM-5.2 Jun 20, 2026
@rekram1-node rekram1-node merged commit 22cc758 into anomalyco:dev Jun 20, 2026
9 of 10 checks passed
thdxr pushed a commit that referenced this pull request Jun 21, 2026
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
ausard pushed a commit to ausardcompany/alexi that referenced this pull request Jun 21, 2026
Adds modelSupportsReasoningEffort(modelId) helper to model-match.ts
returning 'none' | 'binary' | 'levels'. buildDeepSeekRequest now
dispatches on this helper instead of unconditionally writing
reasoning_effort. Default mode is 'levels' when modelId is omitted,
preserving existing DeepSeek behaviour bit-for-bit.

Pre-empts the GLM-style regression seen upstream (anomalyco/opencode#32446)
where a blanket id.includes() gate silently dropped variants when
new model versions arrived.

Closes #819

[alexi-bot]
ausard added a commit to ausardcompany/alexi that referenced this pull request Jun 21, 2026
Adds modelSupportsReasoningEffort(modelId) helper to model-match.ts
returning 'none' | 'binary' | 'levels'. buildDeepSeekRequest now
dispatches on this helper instead of unconditionally writing
reasoning_effort. Default mode is 'levels' when modelId is omitted,
preserving existing DeepSeek behaviour bit-for-bit.

Pre-empts the GLM-style regression seen upstream (anomalyco/opencode#32446)
where a blanket id.includes() gate silently dropped variants when
new model versions arrived.

Closes #819

[alexi-bot]

Co-authored-by: alexi-bot <alexi-bot@users.noreply.github.com>
markjaquith pushed a commit to markjaquith/opencode that referenced this pull request Jun 23, 2026
BenGu3 pushed a commit to BenGu3/opencode that referenced this pull request Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GLM-5.2 thinking-effort variants (High/Max) not exposed — blanket 'glm' exclusion in variants()

2 participants