fix(known-provider-models): align direct Z.ai GLM-5.2 reasoning efforts#175
Open
andrei-hasna wants to merge 1 commit into
Open
Conversation
andrei-hasna
force-pushed
the
openloops/open-codewith/263480b2-e3b0-41cc-a2ba-e460ef304d89-09d1a500
branch
2 times, most recently
from
July 9, 2026 13:14
015d93c to
d208395
Compare
Direct Z.ai docs (docs.z.ai/guides/llm/glm-5.2 and the chat-completion API
reference, accessed 2026-07-02) show GLM-5.2 exposes the granular
reasoning_effort scale (max, xhigh, high, medium, low, minimal, none) with a
default of max, while other GLM models only offer the binary thinking toggle.
Split zai::reasoning_levels so glm-5.2 and glm-5.2[1m] surface the full scale
with a Custom("max") default; the remaining GLM slugs keep the existing
None/Medium binary preset. ReasoningEffort has no first-class Max variant, so
max is represented via Custom("max"), which serializes to the exact wire
value.
Adds regression coverage in known-provider-models and app-server (unit +
model/list fallback) asserting the corrected default and supported efforts for
direct Z.ai GLM-5.2 and that other GLM models are unchanged.
andrei-hasna
force-pushed
the
openloops/open-codewith/263480b2-e3b0-41cc-a2ba-e460ef304d89-09d1a500
branch
from
July 9, 2026 13:25
d208395 to
4ab9f5c
Compare
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.
Summary
Aligns the direct Z.ai GLM-5.2 reasoning-effort presets with the current Z.ai API docs.
Direct Z.ai docs (guides/llm/glm-5.2 and the chat-completion API reference, accessed 2026-07-02) show GLM-5.2 exposes the granular
reasoning_effortscale (max,xhigh,high,medium,low,minimal,none) with a default ofmax. Only GLM-5.2 supports this scale; other GLM models only offer the binary thinking enabled/disabled toggle.Changes
known-provider-models/src/zai.rs: splitreasoning_levelssoglm-5.2andglm-5.2[1m]surface the full granular scale with aCustom("max")default; the remaining GLM slugs keep the existingNone/Mediumbinary preset (does not blindly change every GLM model).known-provider-models(unit) andapp-server(models.rsunit +model_listsuite fallback listing) asserting the corrected default and supported efforts for direct Z.ai GLM-5.2 and that other GLM models are unchanged.API gap note
ReasoningEfforthas no first-classMaxvariant, somaxis represented viaCustom("max"), which serializes to the exact wire valuemaxand round-trips (already tested inopenai_models.rs). No functional gap remains, so no separate follow-up is warranted; a first-classMaxvariant would be a separate protocol change if ever desired. OpenRouter's aggregator-reportedxhigh/highis not used to widen direct support.Validation
just test-fast -p codex-known-provider-models zai— 2 passedjust test-fast -p codex-app-server model_list— 15 passedjust fmtjust fix -p codex-known-provider-models/just fix -p codex-app-server— clean🤖 Generated with Claude Code