fix(opencode): expose High/Max thinking variants for GLM-5.2#32446
Open
imranshaiedi-byte wants to merge 1 commit into
Open
fix(opencode): expose High/Max thinking variants for GLM-5.2#32446imranshaiedi-byte wants to merge 1 commit into
imranshaiedi-byte wants to merge 1 commit into
Conversation
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
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