[Bug] Z.AI GLM: reasoning_effort never sent, so /effort levels have no effect #1456
ruttybob
started this conversation in
Bug reports
Replies: 1 comment
|
PR #1565 implements essentially your proposed sketch, with two corrections from live probing the coding endpoint:
Direct z.ai effort-capable models get |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Affected area: AI providers and models
What happened?
Z.AI models with
thinkingFormat: "zai"only sendenable_thinking: true/falsein API requests —reasoning_effortis never sent. Selecting different effort levels in/efforttherefore has no effect: the API receives identical requests forhighandmax. Additionally, Z.AI models have nothinkingLevelMap, so the selector offers levels that are meaningless for these models.Two root causes, both still present on current
main(verified onmain@ 06e4a19):detectCompathardcodes Z.AI off (openai-completions.ts:1119):thinkingFormat: "zai"handler only sets the boolean toggle (openai-completions.ts:569):Steps to reproduce
glm-5.2) and open/effortthinkingLevelMap)highandmax— requests tohttps://api.z.ai/api/coding/paas/v4/chat/completionsare identical apart from the booleanExpected behavior
Effort levels should map to a
reasoning_effortrequest parameter, and the/effortselector should only show levels the model actually distinguishes.Prime Agent version: observed on 0.7.1, re-verified on
main@ 06e4a19Environment: macOS (Darwin)
Additional context
Measured on
glm-5.2withthinking+reasoning_effortsent manually — the API does honour effort levels:glm-4.7,glm-5-turbo,glm-5.2all acceptthinking.type+reasoning_effortalongsideenable_thinkingwithout conflict.Upstream
pialready fixed this direction (earendil-works/pi#5770 effort levels for GLM-5.2; #6083clear_thinking: falsefor Z.AI caching).Proposed fix sketch: add a
thinkingLevelMapfor Z.AI reasoning models ingenerate-models.ts(levels[off, low, medium, high, max]withlow/mediumaliasing tohigh), setsupportsReasoningEffort: truein their compat, and upgrade thezaihandler to also sendreasoning_effortmapped through the level map. I have a working implementation with tests on a branch and can share it if invited.All reactions