fix(zai): expose GLM-5.2 reasoning levels [AI-assisted]#94136
Conversation
b5c21a9 to
89298df
Compare
|
Codex review: needs maintainer review before merge. Reviewed June 20, 2026, 11:56 PM ET / 03:56 UTC. Summary PR surface: Source +39, Tests +102, Docs +5. Total +146 across 4 files. Reproducibility: yes. source-level. Current main exposes only binary Z.AI thinking and lacks GLM-5.2 Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the provider-owned GLM-5.2 thinking profile and payload mapping after maintainers accept the Z.AI request-contract risk and required checks are green or explicitly handled. Do we have a high-confidence way to reproduce the issue? Yes, source-level. Current main exposes only binary Z.AI thinking and lacks GLM-5.2 Is this the best way to solve the issue? Yes. The provider-owned AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6c1041339da6. Label changesLabel justifications:
Evidence reviewedPR surface: Source +39, Tests +102, Docs +5. Total +146 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Updated the PR with the two missing pieces ClawSweeper called out:
Live proof run from this PR branch, with no API key or auth material printed: Local verification also passed: @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
e8a5c03 to
3e59875
Compare
3e59875 to
4322141
Compare
|
Merged via squash.
Thanks @BorClaw! |
Merged via squash. Prepared head SHA: 4322141 Co-authored-by: BorClaw <[email protected]> Co-authored-by: steipete <[email protected]> Reviewed-by: @steipete
…26.6.10) (#1256) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/openclaw/openclaw](https://openclaw.ai) ([source](https://github.com/openclaw/openclaw)) | patch | `2026.6.9` → `2026.6.10` | --- ### Release Notes <details> <summary>openclaw/openclaw (ghcr.io/openclaw/openclaw)</summary> ### [`v2026.6.10`](https://github.com/openclaw/openclaw/blob/HEAD/CHANGELOG.md#2026610) [Compare Source](openclaw/openclaw@v2026.6.9...v2026.6.10) ##### Highlights - **Automatic fast mode for talks:** OpenClaw can enable fast mode for short conversational turns, then return to normal mode for longer runs with bounded fallback and delivery behavior. ([#​85104](openclaw/openclaw#85104)) Thanks [@​alexph-dev](https://github.com/alexph-dev) and [@​vincentkoc](https://github.com/vincentkoc). - **More reliable model routing:** Zai model synthesis, GLM overload failover, and native reasoning-level selection now follow the active model catalog more consistently. ([#​94461](openclaw/openclaw#94461), [#​93241](openclaw/openclaw#93241), [#​94067](openclaw/openclaw#94067), [#​94136](openclaw/openclaw#94136)) Thanks [@​Pandah97](https://github.com/Pandah97), [@​chrysb](https://github.com/chrysb), [@​0xghost42](https://github.com/0xghost42), [@​zhengli0922](https://github.com/zhengli0922), [@​openperf](https://github.com/openperf), [@​civiltox](https://github.com/civiltox), and [@​BorClaw](https://github.com/BorClaw). - **Safer session and channel state:** channel switches reset stale origin fields, and cron delivery awareness stays attached to the target session. ([#​95328](openclaw/openclaw#95328), [#​93580](openclaw/openclaw#93580)) Thanks [@​ZengWen-DT](https://github.com/ZengWen-DT), [@​jalehman](https://github.com/jalehman), [@​gorkem2020](https://github.com/gorkem2020), and [@​scotthuang](https://github.com/scotthuang). - **Trusted policies survive hook composition:** composed hook registries keep the trusted tool policies required by approval-sensitive flows. ([#​94545](openclaw/openclaw#94545)) Thanks [@​jesse-merhi](https://github.com/jesse-merhi). ##### Changes - **Agent and channel runtime:** fast-mode state now survives retries, fallback transitions, progress events, and embedded/CLI/ACP normalization; session and channel routing retain the current target and delivery context. ([#​85104](openclaw/openclaw#85104), [#​93580](openclaw/openclaw#93580), [#​95328](openclaw/openclaw#95328)) Thanks [@​alexph-dev](https://github.com/alexph-dev), [@​vincentkoc](https://github.com/vincentkoc), [@​scotthuang](https://github.com/scotthuang), [@​ZengWen-DT](https://github.com/ZengWen-DT), [@​jalehman](https://github.com/jalehman), and [@​gorkem2020](https://github.com/gorkem2020). - **Provider behavior:** model catalogs now supply the correct Zai base URL, overload classification, and native reasoning controls for live-discovered models. ([#​94461](openclaw/openclaw#94461), [#​93241](openclaw/openclaw#93241), [#​94067](openclaw/openclaw#94067), [#​94136](openclaw/openclaw#94136)) Thanks [@​Pandah97](https://github.com/Pandah97), [@​chrysb](https://github.com/chrysb), [@​0xghost42](https://github.com/0xghost42), [@​zhengli0922](https://github.com/zhengli0922), [@​openperf](https://github.com/openperf), [@​civiltox](https://github.com/civiltox), and [@​BorClaw](https://github.com/BorClaw). ##### Fixes - **Fast-mode and policy correctness:** fallback cutoffs and reset notices are bounded, repeated progress events remain visible, Codex service-tier state is normalized, and trusted policies are not lost when hook registries are composed. ([#​85104](openclaw/openclaw#85104), [#​94545](openclaw/openclaw#94545)) Thanks [@​alexph-dev](https://github.com/alexph-dev), [@​vincentkoc](https://github.com/vincentkoc), and [@​jesse-merhi](https://github.com/jesse-merhi). - **Model and delivery edge cases:** Zai and GLM failover paths use the right runtime metadata, while stale channel-origin state no longer leaks across session changes. ([#​94461](openclaw/openclaw#94461), [#​93241](openclaw/openclaw#93241), [#​95328](openclaw/openclaw#95328)) Thanks [@​Pandah97](https://github.com/Pandah97), [@​chrysb](https://github.com/chrysb), [@​0xghost42](https://github.com/0xghost42), [@​zhengli0922](https://github.com/zhengli0922), [@​ZengWen-DT](https://github.com/ZengWen-DT), [@​jalehman](https://github.com/jalehman), and [@​gorkem2020](https://github.com/gorkem2020). - **Provider plugin onboarding:** setup refreshes provider plugin registry metadata after installing setup-selected provider plugins, so auth continuation uses the newly installed provider instead of stale registry state. ([#​95792](openclaw/openclaw#95792)) Thanks [@​snowzlmbot](https://github.com/snowzlmbot). ##### Complete contribution record This audited record covers the complete v2026.6.9..HEAD history: 12 merged PRs. The generation manifest also supplies direct commits as editorial input; the grouped notes above prioritize user impact. ##### Pull requests - **PR [#​86627](openclaw/openclaw#86627 Keep core doctor health in contribution order. Thanks [@​giodl73-repo](https://github.com/giodl73-repo). - **PR [#​93580](openclaw/openclaw#93580 fix: preserve cron delivery awareness for target sessions. Thanks [@​scotthuang](https://github.com/scotthuang) and [@​jalehman](https://github.com/jalehman). - **PR [#​95030](openclaw/openclaw#95030 refactor: add SDK transcript identity target API. Thanks [@​jalehman](https://github.com/jalehman). - **PR [#​94838](openclaw/openclaw#94838 refactor(copilot): complete harness lifecycle parity. Thanks [@​vincentkoc](https://github.com/vincentkoc). - **PR [#​95328](openclaw/openclaw#95328 fix(sessions): reset stale per-channel origin fields on channel switch. Related [#​95325](openclaw/openclaw#95325). Thanks [@​ZengWen-DT](https://github.com/ZengWen-DT) and [@​jalehman](https://github.com/jalehman) and [@​gorkem2020](https://github.com/gorkem2020). - **PR [#​94461](openclaw/openclaw#94461 fix(zai): fall back to manifest baseUrl for synthesized GLM-5 models. Related [#​94269](openclaw/openclaw#94269). Thanks [@​Pandah97](https://github.com/Pandah97) and [@​chrysb](https://github.com/chrysb). - **PR [#​93241](openclaw/openclaw#93241 fix(agents): classify Zhipu GLM overload as overloaded for failover. Related [#​93211](openclaw/openclaw#93211). Thanks [@​0xghost42](https://github.com/0xghost42) and [@​zhengli0922](https://github.com/zhengli0922). - **PR [#​94067](openclaw/openclaw#94067 fix(channels): resolve native /think menu levels via runtime catalog for live-discovered models. Related [#​93835](openclaw/openclaw#93835). Thanks [@​openperf](https://github.com/openperf) and [@​civiltox](https://github.com/civiltox). - **PR [#​94136](openclaw/openclaw#94136 fix(zai): expose GLM-5.2 reasoning levels \[AI-assisted]. Thanks [@​BorClaw](https://github.com/BorClaw). - **PR [#​85104](openclaw/openclaw#85104 feat: fast talks auto mode. Related [#​85087](openclaw/openclaw#85087). Thanks [@​alexph-dev](https://github.com/alexph-dev). - **PR [#​94545](openclaw/openclaw#94545 fix: keep trusted policies with hook registry. Thanks [@​jesse-merhi](https://github.com/jesse-merhi). - **PR [#​95792](openclaw/openclaw#95792 fix(onboard): refresh provider plugin registry after setup installs. Related [#​95765](openclaw/openclaw#95765). Thanks [@​snowzlmbot](https://github.com/snowzlmbot). </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjEwMS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19--> Reviewed-on: https://git.erwanleboucher.dev/eleboucher/homelab/pulls/1256
Summary
glm-5.2was present in the bundled provider, but OpenClaw still exposed Z.AI thinking as binaryoff/onand did not send Z.AIreasoning_effortfor GLM-5.2 high/max thinking.off,low,high,maxreasoning controls from OpenClaw.glm-5.2now advertisesoff,low,high, andmax; payload wrapping mapslow/hightoreasoning_effort: "high",max/xhightoreasoning_effort: "max", andoff/minimaltothinking: { type: "disabled" }.off/on; GLM-5.2 catalog metadata was already correct upstream and is not changed here.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Users selecting
zai/glm-5.2can chooseoff,low,high, ormaxthinking levels. Other Z.AI GLM models continue to show binaryoff/onthinking controls.Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation: N/ARepro + Verification
Environment
zai/glm-5.2Steps
glm-5.2andglm-5.1.glm-5.2stream withlow,high, andmaxthinking levels.openclaw infer model runpath withoff,high, andmaxthinking.Expected
glm-5.2exposesoff,low,high,max.glm-5.1remains binaryoff/on.lowandhighsendreasoning_effort: "high".maxsendsreasoning_effort: "max".offdisables thinking.off,high, andmaxreturn successful model text.Actual
Evidence
Focused coverage was added in
extensions/zai/index.test.tsfor profile exposure and payload mapping.Live redacted proof from this PR branch:
No API key or auth material is included in the proof output.
Human Verification (required)
CI=true pnpm format -- docs/tools/thinking.md docs/providers/zai.md extensions/zai/index.ts extensions/zai/index.test.tsCI=true pnpm exec vitest run extensions/zai/index.test.ts extensions/zai/model-definitions.test.ts src/auto-reply/thinking.test.tsCI=true pnpm tsgoCI=true pnpm lintpnpm openclaw infer model run --local --model zai/glm-5.2 --thinking off --prompt 'Reply exactly: ZAI_off_OK' --jsonpnpm openclaw infer model run --local --model zai/glm-5.2 --thinking high --prompt 'Reply exactly: ZAI_high_OK' --jsonpnpm openclaw infer model run --local --model zai/glm-5.2 --thinking max --prompt 'Reply exactly: ZAI_max_OK' --jsonglm-5.1remains binaryoff/on.maxuses the new nativemaxthinking level rather than the olderxhighworkaround.low,medium,adaptive,xhigh); the live proof coversoff,high, andmax, while tests cover the alias mapping.AI-assisted: yes. Patch authored with Codex/OpenClaw assistance and manually reviewed before submission.
Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoFailure Recovery (if this breaks)
extensions/zai/index.ts,extensions/zai/index.test.ts,docs/providers/zai.md,docs/tools/thinking.md.reasoning_effort, incorrect/thinkchoices for GLM-5.2, or unexpected changes to non-GLM-5.2 Z.AI thinking choices.Risks and Mitigations
reasoning_effortvalues.off,high, andmax.