You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reuses the GLM-5.3 profile for most details: effort levels, reasoning config, and prices. Prices for 5.4 are a guess because real prices are not yet published.
GLM-5.4 supports images and files.
Test Procedure
New unit tests cover the model catalog entry and the handler's request parameters for the model.
Also manually tested image handling.
Recorded Stream (new provider only)
New model, not new provider.
Pre-Submission Checklist
Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
Listing Discussion (new provider or MCP server only): I opened a GitHub Discussion for this listing and linked it in the PR description.
Recorded Stream (new provider only): I added one recorded streaming response. It shows the finish chunk. If the handler reads cost or usage from chunks, it also shows the usage chunk.
Scope: My changes are focused on the linked issue (one major feature/fix per PR).
Self-Review: I reviewed my own code with care.
Writing Style: The PR title and description use Simplified Technical English (ASD-STE100): short sentences, plain words, active voice, one idea per sentence, no contractions.
Testing: New and/or updated tests have been added to cover my changes (if applicable).
Test Helpers (test changes only): Shared test helpers (src/test-utils/, @/utils/test-utils) are used only for mechanical duplication; test intent and scenario-specific mocks remain visible.
Visual Snapshot (UI changes only): If a user would notice this change at a glance (layout, theme tokens, brand elements, empty/error states), I added or updated a *.visual.tsx snapshot in webview-ui/. See webview-ui/AGENTS.md → "When a UI change needs a snapshot".
Documentation Impact: I checked if my changes need documentation updates (see "Documentation Updates" section below).
Added GLM-5.4 to supported Z.ai international and mainland Coding Plan model options. International Model API support is also available; mainland Model API support is not included.
GLM-5.4 supports image input, configurable reasoning effort, and up to a 1M-token context window.
Streaming requests now preserve reasoning for GLM-5.4.
GLM-5.4 is added to Z.ai international catalogs and mainland Coding Plan catalogs. Provider request handling now recognizes it alongside GLM-5.3 models. Tests cover model metadata, endpoint availability, model selection, and streaming request defaults.
Changes: GLM-5.4 model support
Layer / File(s)
Summary
Catalog entries and model availability packages/types/src/providers/lite-llm.ts, packages/types/src/providers/zai.ts, src/api/providers/__tests__/zai.spec.ts, webview-ui/src/components/settings/utils/__tests__/providerModelConfig.spec.ts, webview-ui/src/components/ui/hooks/__tests__/useSelectedModel.spec.ts
The catalogs add GLM-5.4 for international configurations and mainland Coding Plan configurations. Tests check model metadata, endpoint availability, and selected-model resolution.
This adds GLM-5.4 to Z.ai with GLM-5.3 reasoning behavior and provisional pricing. Users on the international standard API endpoint can select the model even though Z.AI says it is not yet available there, which may produce request errors. Confirm the intended availability before merging. The rest of the change is low risk.
Important
Pre-merge checks failed
Please resolve all errors before merging. Addressing warnings is optional.
Failed checks: 1 warning · 1 inconclusive
Check name
Status
Explanation
Resolution
Regression Evidence
The PR changes isGlm53Model in src/api/providers/zai.ts (line 36) to match glm-5.4. That predicate gates two request paths: createStreamWithThinking (line 116) and completePrompt (lines 152-…
Add a unit test in src/api/providers/__tests__/zai.spec.ts next to the existing GLM-5.3 completePrompt tests. Use apiModelId: "glm-5.4" and zaiApiLine: "international_coding". Mock create to resolve with a response, call `complete…
Out of Scope Changes check
The issue says the standard pay-as-you-go API is not live yet. The PR adds GLM-5.4 to internationalZAiModels, which the PR summary says is the standard international API catalog. The webview test al…
Confirm whether the international glm-5.4 entry in internationalZAiModels and the Model API test expectation in providerModelConfig.spec.ts should ship before the standard API is live. If they should not ship, remove them or document …
Passed checks: 6 passed
Check name
Status
Explanation
Title check
The title "Add Z.AI's GLM-5.4." matches the main change: adding the GLM-5.4 model to the Z.AI provider across the model catalogs, handler, and tests. It is short and specific, though it omits that the…
Description check
The description covers the linked issue (Closes #2683), a summary of what the PR adds, and a test procedure. It fills in the pre-submission checklist and the documentation impact check. Some template …
Linked Issues check
Directly linked issue #2683 asks for GLM-5.4 with API ID glm-5.4, 1,000,000-token context, 128,000-token max output, text/image/video/file input, text output, and native tool calling, streaming, thi…
Security Boundaries
Security boundaries check: PASS. I reviewed the six changed files in the reviewed range (PR #2775 by georgedorn, head feature/glm-5.4 into main). - packages/types/src/providers/lite-llm.ts: adds "glm-…
Persistence Integrity
The Persistence integrity check fails only when a changed persistence path can lose or corrupt state. This PR changes no persistence path. The diff (git diff --name-status against the review base) t…
Lifecycle Resource Cleanup
The check fails only when a changed lifecycle path can leak a listener, watcher, provider, timer, task, or other resource, or duplicate work after cancellation, disposal, or restart. The reviewed rang…
Full details: Title check
Explanation
The title "Add Z.AI's GLM-5.4." matches the main change: adding the GLM-5.4 model to the Z.AI provider across the model catalogs, handler, and tests. It is short and specific, though it omits that the model is Coding Plan-only and that the handler applies GLM-5.3-style settings.
Full details: Description check
Explanation
The description covers the linked issue (Closes #2683), a summary of what the PR adds, and a test procedure. It fills in the pre-submission checklist and the documentation impact check. Some template parts are unfilled or left as template text: the Recorded Stream section says it is not applicable, which is accurate for a new model. The Discord username field is not filled in, and the author states they will not provide one. The Visual Snapshots and Videos sections keep template text, which is acceptable because the PR has no UI change. The Documentation Updates section has no selected option. The description also says prices are guesses, which is a concern a reviewer should check.
Resolution
Optional: tick one option under Documentation Updates. Optional: replace the Get in Touch comment with a short note that the author will not share a Discord username, so reviewers know this is intentional. Confirm that the provisional GLM-5.3-based prices are acceptable before merge, since the issue says pricing was pending.
Full details: Linked Issues check
Explanation
Directly linked issue #2683 asks for GLM-5.4 with API ID glm-5.4, 1,000,000-token context, 128,000-token max output, text/image/video/file input, text output, and native tool calling, streaming, thinking, caching, and structured output. The diff of packages/types/src/providers/zai.ts adds a glm-5.4 entry to mainlandZAiCodingPlanOnlyModels and to internationalZAiModels. Both entries spread glm53ModelInfo, set supportsImages: true, and describe a 1M context window, 128k max output, and multimodal input. The PR summary says zai.spec.ts tests GLM-5.4 metadata, and providerModelConfig.spec.ts and useSelectedModel.spec.ts test catalog availability. The zai.ts change applies clear_thinking: false to GLM-5.4 requests. The issue's coding requirements are met by the catalog entries and tests. Feature flags such as tool calling, caching, and structured output are inherited from glm53ModelInfo, which was not inspected. The issue's pricing is non-coding and the PR uses provisional GLM-5.3 prices, as the PR describes.
Full details: Security Boundaries
Explanation
Security boundaries check: PASS. I reviewed the six changed files in the reviewed range (PR #2775 by georgedorn, head feature/glm-5.4 into main). - packages/types/src/providers/lite-llm.ts: adds "glm-5.4" to LITELLM_PRESERVE_REASONING_MODEL_IDS. This is a static list entry, not input handling or an access control. - packages/types/src/providers/zai.ts: adds GLM-5.4 catalog entries for the international and mainland Coding Plan-only lists, with prices, context, and a doc link. These are static data. No secrets or personal data appear. - src/api/providers/zai.ts: extends isGlm53Model with an exact-equality match on "glm-5.4". This sets clear_thinking: false for that model. The model ID is compared as a fixed string and does not reach a parser, shell, or query. No validation or approval step is removed. - Test files: add catalog and request-parameter assertions. Matches for "key" and "token" are the placeholder test-zai-api-key and test values, not real credentials. No changed path exposes a secret or personal data, executes unvalidated input, or bypasses an approval or allowlist control. The mainland Model API entry is correctly excluded, and a test asserts that exclusion. No security-boundary defect is present.
Full details: Persistence Integrity
Explanation
The Persistence integrity check fails only when a changed persistence path can lose or corrupt state. This PR changes no persistence path. The diff (git diff --name-status against the review base) touches six files: a model ID added to LITELLM_PRESERVE_REASONING_MODEL_IDS in packages/types/src/providers/lite-llm.ts, GLM-5.4 catalog entries in packages/types/src/providers/zai.ts, a isGlm53Model predicate in src/api/providers/zai.ts, and four test files. The zai.ts change only extends the predicate so that clear_thinking: false is sent in the request body for glm-5.4. That is request-shaping, not storage or state writes. A keyword scan of the full diff for await, writeFile, globalState, secrets, storage, persist, rename, and JSON.stringify found only one await messageGenerator.next() line, which sits in a test file. No write, rename, or serialization path changed, so no non-awaited write, non-atomic write, rollback gap, or lost default can be traced to this PR. Primary PR: #2775, author georgedorn.
Full details: Lifecycle Resource Cleanup
Explanation
The check fails only when a changed lifecycle path can leak a listener, watcher, provider, timer, task, or other resource, or duplicate work after cancellation, disposal, or restart. The reviewed range (base to head) changes six files, and none of them touches a lifecycle path: - packages/types/src/providers/lite-llm.ts: adds "glm-5.4" to the LITELLM_PRESERVE_REASONING_MODEL_IDS tuple. This is static data. - packages/types/src/providers/zai.ts: adds glm-5.4 catalog entries for the international and mainland Coding Plan-only models. These are static object literals, plus a comment URL. - src/api/providers/zai.ts: changes isGlm53Model from a two-value equality check to a three-value check that adds glm-5.4. This is a pure predicate. It changes the clear_thinking request parameter and creates no listeners, timers, or provider instances. - The three test files only add assertions. No new or changed code subscribes to events, starts watchers or timers, creates provider instances, or spawns tasks. No cancellation, disposal, or restart path changed. The check has no applicable changed lifecycle path, so it passes.
Full details: Regression Evidence
Explanation
The PR changes isGlm53Model in src/api/providers/zai.ts (line 36) to match glm-5.4. That predicate gates two request paths: createStreamWithThinking (line 116) and completePrompt (lines 152-155, 163). The diff adds a GLM-5.4 test for the streaming path only. The new test "should use the GLM-5.3 thinking and sampling defaults for GLM-5.4" calls createMessage, and asserts thinking: { type: "enabled", clear_thinking: false }, reasoning_effort: "max", and temperature: 1. No test covers the completePrompt path for glm-5.4. The same spec file already tests completePrompt for both existing GLM-5.3 variants (should use the official GLM-5.3 parameters for completePrompt and should use the official GLM-5.3-Flash parameters for completePrompt, around lines 850-885). completePrompt sends a different request shape: it is non-streaming and sends reasoning_effort directly. The PR's changed behavior for glm-5.4 in that path therefore has no assertion at the unit-test layer, while the file already sets this pattern for every other GLM-5.3 model. Other changed behavior has adequate coverage. The catalog entries are checked in zai.spec.ts (international coding and API, contextWindow 1,000,000, pricing) and in useSelectedModel.spec.ts (china_coding inputPrice 0.68). Negative cases are covered: china_api excludes glm-5.4 in zai.spec.ts, and mainland API excludes it in providerModelConfig.spec.ts. The lite-llm.ts list entry is mechanical configuration and needs no test. The prior FAIL details are unavailable, so I cannot confirm which concern it raised. I cannot dispose of it with priorFailureDisposition, so this run records FAIL.
Resolution
Add a unit test in src/api/providers/__tests__/zai.spec.ts next to the existing GLM-5.3 completePrompt tests. Use apiModelId: "glm-5.4" and zaiApiLine: "international_coding". Mock create to resolve with a response, call completePrompt("prompt"), and assert that the call includes model: "glm-5.4", thinking: { type: "enabled", clear_thinking: false }, and reasoning_effort: "max". Run the zai spec file to confirm it passes.
Full details: Out of Scope Changes check
Explanation
The issue says the standard pay-as-you-go API is not live yet. The PR adds GLM-5.4 to internationalZAiModels, which the PR summary says is the standard international API catalog. The webview test also expects GLM-5.4 to be available for the international Model API entrypoint. This goes beyond the Coding Plan scope in #2683. The PR description does not explain this choice. The mainland catalog change and the packages/types/src/providers/lite-llm.ts and zai.ts changes are directly tied to the model and do not appear out of scope. The raw summary describes the international catalog as Coding Plan-only, which conflicts with the diff. The diff shows it is not Coding Plan-only, so the diff is treated as correct.
Resolution
Confirm whether the international glm-5.4 entry in internationalZAiModels and the Model API test expectation in providerModelConfig.spec.ts should ship before the standard API is live. If they should not ship, remove them or document the reason. If they should ship, state the reason in the PR description.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Thanks for contributing. This comment tracks the review sequence and the next action.
Current step: Required CI passed. Waiting for automated review of the latest commit.
If automated review does not start, a maintainer must restart it.
Review-state labels are managed by this workflow; do not edit them manually. community-approved is managed the same way — do not add or remove it manually. It signals a fresh community code approval for the current head as an advisory priority only; maintainer review is still required.
The reason will be displayed to describe this comment to others. Learn more.
Additional comments: 1
packages/types/src/providers/zai.ts-220-220: 1
220-220: Major · Functional Correctness · Quick win
Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Keep GLM-5.4 out of the international API catalog.
Z.AI states that GLM-5.4 is available through Coding Plans, while Model API availability is still pending. (docs.z.ai)
This shared catalog also serves international_api. Users can therefore select GLM-5.4 on an endpoint that does not support it. Keep this entry in an international Coding Plan-only catalog. Merge it only for international_coding. Update the provider and webview tests to reject international_api presence while retaining Coding Plan coverage.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
Review details
Additional context used
Code guidelines: 1
webview-ui/AGENTS.md — auto-discovered
Path-based instructions: 9
Treat model, provider, MCP, path, command, and tool data as untrusted input.
CodeRabbit configuration file
Files:
src/api/providers/__tests__/zai.spec.ts
src/api/providers/zai.ts
For saved settings, trace the schema, storage, runtime, and webview in both directions.
Source excerpt: **Patch Gate (`target: 70%`)**: New or modified lines in PRs touching `webview-ui/src/` must meet minimum test coverage, ensuring state changes and new UI logic stay tested over time.
Pricing check: Z.AI now publishes the GLM-5.4 prices on the pricing page (https://docs.z.ai/guides/overview/pricing, table "Latest Models"): Input $1.4, Cached Input $0.26, Cached Input Storage "Limited-time Free", Output $4.4 per 1M tokens (USD).
These values are identical to the GLM-5.3 prices that this PR copies. Thus the TODO: pricing is from GLM-5.3 comment and the sentence "Prices for 5.4 are a guess" in the description are obsolete. You can remove both.
Scope: I checked the international prices only. I did not verify the china_coding values (0.68 / 2.28 / 0.13).
@taltas Yes. The coverage gap should not block approval.
The GLM-5.4 streaming test covers the shared model predicate, but completePrompt has no GLM-5.4-specific test. A test of its request parameters would reduce regression risk. The repository’s regression-evidence guidance supports identifying this gap; it does not establish a defect. The saved check is a warning.
GitHub reported APPROVED when I checked, but Zoo Code / PR review gate was still pending. Separately, please confirm GLM-5.4 availability on the international Model API before merge. The earlier scope check was inconclusive.
Learnings used
Learnt from: CR
Repo: Zoo-Code-Org/Zoo-Code PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-11-28T02:20:02.382Z
Learning: Source excerpt:
Regression evidence: Fail only when changed behavior has a concrete test gap at the lowest valid test layer. Examples include tests that copy the implementation and missing relevant negative, error, or unset cases. Also check for missing required snapshots for visible UI changes. Do not demand tests for unchanged behavior or mechanical configuration changes. Do not demand coverage of a branch without a plausible regression case. Cite the changed behavior and the missing evidence.
@taltas The approval workflow will check for blocking findings and review readiness.
Before merge, please confirm GLM-5.4 availability on the international Model API. The saved scope check was inconclusive.
Learnings used
Learnt from: CR
Repo: Zoo-Code-Org/Zoo-Code PR: 0
File: coderabbit-custom-pre-merge-checks-unique-id-file-non-traceable-F7F2B60C-1728-4C9A-8889-4F2235E186CA.txt:0-0
Timestamp: 2026-11-28T02:20:02.382Z
Learning: Source excerpt:
Regression evidence: Fail only when changed behavior has a concrete test gap at the lowest valid test layer. Examples include tests that copy the implementation and missing relevant negative, error, or unset cases. Also check for missing required snapshots for visible UI changes. Do not demand tests for unchanged behavior or mechanical configuration changes. Do not demand coverage of a branch without a plausible regression case. Cite the changed behavior and the missing evidence.
Action performed
Changes approved. Review threads were not changed.
…edicate
The branch was dirty against main over one file, src/api/providers/zai.ts.
Main advanced by 4 commits since the recorded base, one of which touches
that file: 5c36069 "Add z.ai's glm-5.4 with 1M context instead of 128K
default (Zoo-Code-Org#2775)". The conflict was positional, not semantic: main extended
isGlm53Model with the glm-5.4 member plus its doc block, while this chain
added the OpenAiRequestConfig type immediately above the same predicate.
The resolution keeps both - the chain's type block, and main's doc block and
extended predicate verbatim from main - so neither side's content is edited
here. The file is prettier-clean at these bytes (prettier --check
api/providers/zai.ts exit 0 after --write removed one trailing blank line I
had left) and eslint --max-warnings=0 on the same file exits 0.
A suite reading the merged tree on this host reports three red rows in
api/providers/__tests__/zai.spec.ts about glm-5.4 (`expected {
contextWindow: 128000, ... } to match object { contextWindow: 1000000, ... }`,
`expected { 'glm-4.5': { ... }, ... } to have property "glm-5.4"`). They are
a dependency-resolution artifact, not a merge defect: this worktree resolves
@roo-code/types through a junction into an older worktree whose types file
contains glm-5.4 zero times, while the merged source at this commit carries
glm-5.4 at packages/types/src/providers/zai.ts lines 18, 220 and 544, and
main's own spec rows are the ones asking for it. CI builds the package from
the source in the tree, so it does not inherit the stale copy.
No marker is attached: this commit answers the dirty merge state, not an open
review thread. Not closed by this commit: review-thread work on the chain's
own cells is separate, and a merge commit settles text only - behaviour is
judged by the suites run against it, not by the merge succeeding.
CI's ubuntu unit job fails on this branch with exactly one red row,
api/providers/__tests__/zai.spec.ts, "should use the GLM-5.3 thinking and
sampling defaults for GLM-5.4", whose only difference from its sibling rows
is that it expects the mock to have been called with one argument:
AssertionError: expected "vi.fn()" to be called with arguments:
[ ObjectContaining{...} ]
... + undefined,
Number of calls: 1
The chain hands the per-request options to the SDK as a second argument at
zai.ts:146-149, so a call with nothing to forward arrives as (params,
undefined) rather than (params). Every other row in this describe block was
updated to say so when the plumbing landed (commit 4e1d15f wires
cancellation and timeouts through the family, and its rows carry an explicit
undefined expectation at line 1250); the glm-5.4 row came in from main's
5c36069 ("Add z.ai's glm-5.4 with 1M context instead of 128K default
(Zoo-Code-Org#2775)") after this branch was cut, so it still asserts the old arity. The
resolution of that merge kept main's text verbatim, which was right for the
production file and wrong for this one row.
Two runs show the mechanism rather than asserting it. Deleting the sibling
row's undefined expectation - a row that runs on this host because its model
is present in the copy the worktree resolves - turns it red with the same
shape, received arguments (params, undefined), Number of calls: 1, which
proves the expectation is what distinguishes pass from fail. Deleting the
second argument from zai.ts:148 instead turns 17 rows red, so the production
arity is load-bearing for the chain's own rows and this fix does not weaken
anything by matching the expectation to it.
The change is one line in a spec file, so the mutation caliber is unchanged:
scripts/stryker-diff.mjs excludes /__tests__/ at line 85 and *.spec.ts at
line 207, and packageForPath returns undefined for this path, so nothing here
is routed into the executable-line budget measured at base
dd30249, package extension. prettier
--check on the file exits 0 and eslint --max-warnings=0 on it exits 0.
Not closed by this commit: the ubuntu job is judged by CI at the pushed
bytes, and this host still reports three red rows in this file because it
resolves @roo-code/types through a junction into an older worktree that does
not carry glm-5.4 at all - that is the resolution artifact described in the
merge commit, not something this line can fix.
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
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.
Related GitHub Issue
Closes: #2683
Description
Adds the GLM-5.4 model to the Z.AI provider.
Reuses the GLM-5.3 profile for most details: effort levels, reasoning config, and prices. Prices for 5.4 are a guess because real prices are not yet published.
GLM-5.4 supports images and files.
Test Procedure
New unit tests cover the model catalog entry and the handler's request parameters for the model.
Also manually tested image handling.
Recorded Stream (new provider only)
New model, not new provider.
Pre-Submission Checklist
src/test-utils/,@/utils/test-utils) are used only for mechanical duplication; test intent and scenario-specific mocks remain visible.*.visual.tsxsnapshot inwebview-ui/. Seewebview-ui/AGENTS.md→ "When a UI change needs a snapshot".Visual Snapshots
Videos (interaction / animation only)
Documentation Updates
Additional Notes
Get in Touch
Don't have Discord, don't want Discord, definitely wouldn't put my Discord username in a public doc.