feat: add glm-5.2 support#608
Conversation
Introduces a Max reasoning-effort tier; High is the default and Max is opt-in.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughAdds GLM-5.2 support and a new "max" reasoning-effort tier: extends types/schemas, inserts glm-5.2 into Z.ai model catalogs, implements conditional streaming of reasoning_effort in ZAi requests, adds tests for payload behavior, and updates UI locale strings and changeset metadata. ChangesGLM-5.2 Reasoning Effort Support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
edelauna
left a comment
There was a problem hiding this comment.
thanks for adding this - had a couple comments related to the implementation.
…is unsupported Persisted reasoning effort not offered by the current model now falls back to the model default instead of silently disabling reasoning. Also wraps create() in handleOpenAIError for consistency with the base class, and flags GLM-5.2 pricing as provisional (mirrors GLM-5.1).
Introduces a Max reasoning-effort tier; High is the default and Max is opt-in.
Related GitHub Issue
Closes: #597
Description
Adds support for Zhipu's GLM-5.2 model to the Z.ai provider.
Key implementation details:
packages/types/src/providers/zai.tswith a 1M context window, 128k max output, and prompt caching. Pricing is not released yet at this time.packages/types/src/model.ts(confirmed against the API: reasoning_effort accepts none|minimal|low|medium|high|xhigh|max).src/api/providers/zai.ts. Design choice: High is the default, Max is opt-in. The parameter is omitted entirely when reasoning is disabled.Test Procedure
Result: 47/47 tests pass, including 5 new tests:
GLM-5.2 international config round-trip (1M context, High/Max tiers, pricing)
GLM-5.2 mainland config round-trip (pricing)
reasoning_effort: "high" sent by default (model default)
reasoning_effort: "max" sent when the user opts into Max
reasoning_effort omitted (and thinking disabled) when reasoning is off
Tested on built extension running
pnpm vsix.Pre-Submission Checklist
Screenshots / Videos
N/A — no UI layout changes.
Documentation Updates
Additional Notes
Get in Touch
MobCode100
Summary by CodeRabbit
New Features
Localization
Tests