Repository navigation
feat: add GLM-5.4 for Z.AI Coding Plan users - #204522
Conversation
Add a GLM-5.4 catalog row (1M context, 128K output, text and image input) with a row-owned thinking profile: off sends thinking disabled, low maps to reasoning_effort "medium" because GLM-5.4's own "low" behaves like thinking off, and high/max send "high"/"max". Coding Plan setup and endpoint detection now prefer glm-5.4, and glm-5.4 succeeds glm-5.3 in the recommended models list.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review endedClawSweeper stopped reviewing this revision because the pull request closed. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7407a6b17f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "supportsReasoningEffort": true, | ||
| "supportedReasoningEfforts": ["medium", "high", "max"], | ||
| "thinkingLevels": ["off", "low", "high", "max"], | ||
| "defaultThinkingLevel": "max" |
There was a problem hiding this comment.
Honor the catalog default in direct GLM-5.4 completions
When a direct/simple completion omits options.reasoning, GLM-5.4 runs with thinking disabled instead of this declared max default. wrapZaiSimpleCompletionStreamFn in extensions/zai/index.ts falls back to the plugin's resolveThinkingProfile, which recognizes only GLM-5.2 and GLM-5.3 and returns off for GLM-5.4; the wrapper then injects thinking: { type: "disabled" }. The new payload test supplies an explicit level for every case, so it misses this default path. Resolve the omitted level from the model's catalog-owned profile rather than the legacy ID-based fallback.
AGENTS.md reference: src/plugins/AGENTS.md:L52-L52
Useful? React with 👍 / 👎.
|
Merged via squash auto-merge.
|
* commit '391dea93e0a97fff97f9f3d5e94eac992b247b09': (21 commits) test(update): cover maintenance release before conversion (#204548) fix(ci): control memory pressure in cron rearm fixture (#204543) fix: align release workflow tests with retained evidence test(ui): open the Settings drawer by keyboard before the Escape check (#204539) fix(ci): avoid redundant globs for literal test inventories (#204529) fix(pr): retain protected resources after native squash merges (#204496) fix(ui): show the check mark on the custom ask_user answer (#199999) chore(ui): refresh control ui locales (#204542) fix(update): build Git releases only once (#204512) fix(ci): avoid repeated full-inventory matching (#204525) test(ci): align exec completion fixtures with process instances (#204507) test(update): replace mocked JSON routing with child proof (#204527) fix(slack): reject system events with an unresolved conversation type (#204444) test(agents): distinguish the source-session root (#204524) perf(ai): keep Responses tool history checkpointed across turns (#204519) feat(zai): add GLM-5.4 as the Coding Plan default (#204522) ci: cover unscheduled test files daily and fail when a test has no scheduled lane (#204472) fix(ci): model a distinct FRV job retry in CLI fixtures (#204517) improve(ui): defer sign-in controls until needed (#204484) test(agents): assert the prepared MCP hook prompt (#204508) ...
Add a GLM-5.4 catalog row (1M context, 128K output, text and image input) with a row-owned thinking profile: off sends thinking disabled, low maps to reasoning_effort "medium" because GLM-5.4's own "low" behaves like thinking off, and high/max send "high"/"max". Coding Plan setup and endpoint detection now prefer glm-5.4, and glm-5.4 succeeds glm-5.3 in the recommended models list. (cherry picked from commit 9125deb) Co-authored-by: RomneyDa <[email protected]>
Add a GLM-5.4 catalog row (1M context, 128K output, text and image input) with a row-owned thinking profile: off sends thinking disabled, low maps to reasoning_effort "medium" because GLM-5.4's own "low" behaves like thinking off, and high/max send "high"/"max". Coding Plan setup and endpoint detection now prefer glm-5.4, and glm-5.4 succeeds glm-5.3 in the recommended models list.
Add a GLM-5.4 catalog row (1M context, 128K output, text and image input) with a row-owned thinking profile: off sends thinking disabled, low maps to reasoning_effort "medium" because GLM-5.4's own "low" behaves like thinking off, and high/max send "high"/"max". Coding Plan setup and endpoint detection now prefer glm-5.4, and glm-5.4 succeeds glm-5.3 in the recommended models list. (cherry picked from commit 9125deb) Companion audit: 1d6b82d is an independent OpenAI model change, not applicable to Z.AI catalog support. Release adaptation: Retain the stable GLM-5.3 default, detect/probe ordering and recommendation list; port the explicit GLM-5.4 catalog, profile and qualification only. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
Z.AI released GLM-5.4 on November 23, 2026 for GLM Coding Plan subscribers. OpenClaw did not know the model, so Coding Plan users could not pick it from the catalog. New setups also still defaulted to GLM-5.3. And without a catalog row, OpenClaw would send GLM-5.4 the older on/off thinking switch, which does not match what the model accepts.
User Impact
User impact: Coding Plan users can select
zai/glm-5.4, and new Coding Plan setups use it by default. It supports 1,048,576-token context, 131,072 output tokens, text and image input, and/think off|low|high|max(defaultmax). The general Z.AI API default staysglm-5.2, because GLM-5.4 is only on the Coding Plan for now.Released installs pick up the new row from the hosted catalog. Their own resolvers do not carry the row's effort mapping, so on those versions
offsends thinking disabled and every other level sends thinking enabled (Z.AI's full-thinking default) withoutreasoning_effort. Offered levels: 2026.11.7 off/on (default off); 2026.10.33 the full ladder (default max); 2026.11.10-beta.3 off/low/high/max (default max).Why This Change Was Made
GLM-5.4 gets its own catalog row, and the row describes its thinking levels. Following the catalog rule for a new model in a known family, there are no new per-model-ID entries in the plugin. What each level sends was chosen from live probes of the Coding Plan API (2026-11-23):
thinking: {type: "disabled"}, sooffsends that. GLM-5.3 does not accept it.reasoning_effort: "low"matched thinking-disabled token for token across paired samples, while"medium"is a real light tier. Solowmaps to"medium", and a user who pickslowstill gets some reasoning."high"and"max"are distinct full tiers. With no effort, the model behaves like"max", somaxis the default.reasoning_effort: an unknown value returns 200. That is why the row lists exactly the efforts the model actually honors.Coding Plan endpoint detection now tries
glm-5.4first, then falls back toglm-5.1andglm-4.7as before.glm-5.4replacesglm-5.3in the recommended-models list. The docs, the Code Mode table and the Coding Plan live smoke now target GLM-5.4. Z.AI also lists video and file input for GLM-5.4; OpenClaw sends text and images, and the docs say so.Evidence
Live end to end on an isolated Gateway with a real Coding Plan key. A fresh state dir and its own port were used, so no existing install or state was touched.
--auth-choice zai-api-key, endpoint detection picked the Coding Plan global endpoint and setzai/glm-5.4as primary.models listshows GLM-5.4 withtext+imageand 1,048,576 context.max),off,lowand explicitmaxall completed.--thinking mediumis rejected with the valid levels listed.exectool call returned the expected output.ZAI_CODING_LIVE_TEST=1 pnpm test:live src/agents/zai.live.test.tspassed.extensions/zai/index.test.tsruns the real zai wrapper and the OpenAI-completions serializer on the shipped row. It checks exactly what each level sends:off→ thinking disabled;minimal/low/medium→"medium";high→"high";xhigh/max→"max".pnpm catalog:compare-released --filter zai(with the fix in fix: let maintainers compare catalog changes against released readers again #204528) completed for 2026.11.7, 2026.10.33 and 2026.11.10-beta.3 against a candidate built from main. The only change on each iszai/glm-5.4becoming listed, with the request shapes described under User Impact. An earlier pre-merge check that ran only each release's zai thinking hook had predicted "on" would send"medium"; the full resolver run superseded it.before_model_requesthook in a throwaway plugin) recorded the fields sent per level through a real Gateway:off→ thinking disabled,low→reasoning_effort: "medium",high→"high",max→"max".Simplification pass: no new modules, helpers or state. The change is one manifest row, two constant/ID updates, docs and tests.