feat(opencode): expose High/Max thinking variants for GLM-5.2#32446
Merged
Conversation
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
thdxr
pushed a commit
that referenced
this pull request
Jun 21, 2026
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
6 tasks
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
…yco#32446) Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
BenGu3
pushed a commit
to BenGu3/opencode
that referenced
this pull request
Jun 27, 2026
…yco#32446) Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #32444
Related: #18598
Type of change
What does this PR do?
GLM-5.2 supports two thinking-effort levels (High and Max), but
ProviderTransform.variants()inpackages/opencode/src/provider/transform.tsreturns{}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/maxvariants. Earlier GLM models (5.1, 5, 4.x) still hit theid.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?
bun typecheckinpackages/opencode— passes cleanoxlinton the edited file — 0 errors (4 pre-existing warnings in untouched code){ high: { reasoningEffort: "high" }, max: { reasoningEffort: "max" } }while GLM-5.1 and earlier still return{}via the existing exclusionScreenshots / recordings
Non-UI change.
Checklist