Skip to content

fix(known-provider-models): align direct Z.ai GLM-5.2 reasoning efforts#175

Open
andrei-hasna wants to merge 1 commit into
mainfrom
openloops/open-codewith/263480b2-e3b0-41cc-a2ba-e460ef304d89-09d1a500
Open

fix(known-provider-models): align direct Z.ai GLM-5.2 reasoning efforts#175
andrei-hasna wants to merge 1 commit into
mainfrom
openloops/open-codewith/263480b2-e3b0-41cc-a2ba-e460ef304d89-09d1a500

Conversation

@andrei-hasna

Copy link
Copy Markdown
Contributor

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_effort scale (max, xhigh, high, medium, low, minimal, none) with a default of max. 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: split reasoning_levels so glm-5.2 and glm-5.2[1m] surface the full granular scale with a Custom("max") default; the remaining GLM slugs keep the existing None/Medium binary preset (does not blindly change every GLM model).
  • Regression coverage in known-provider-models (unit) and app-server (models.rs unit + model_list suite 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

ReasoningEffort has no first-class Max variant, so max is represented via Custom("max"), which serializes to the exact wire value max and round-trips (already tested in openai_models.rs). No functional gap remains, so no separate follow-up is warranted; a first-class Max variant would be a separate protocol change if ever desired. OpenRouter's aggregator-reported xhigh/high is not used to widen direct support.

Validation

  • just test-fast -p codex-known-provider-models zai — 2 passed
  • just test-fast -p codex-app-server model_list — 15 passed
  • just fmt
  • just fix -p codex-known-provider-models / just fix -p codex-app-server — clean

🤖 Generated with Claude Code

@andrei-hasna
andrei-hasna force-pushed the openloops/open-codewith/263480b2-e3b0-41cc-a2ba-e460ef304d89-09d1a500 branch 2 times, most recently from 015d93c to d208395 Compare July 9, 2026 13:14
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
andrei-hasna force-pushed the openloops/open-codewith/263480b2-e3b0-41cc-a2ba-e460ef304d89-09d1a500 branch from d208395 to 4ab9f5c Compare July 9, 2026 13:25
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.

1 participant