Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Sep 30, 2025

Description

This PR attempts to address Issue #8406 by adding support for the GLM-4.6 model from z.ai (Zhipu AI) with its 200k context window.

Changes

  • Added GLM-4.6 configuration to internationalZAiModels with 200k (204,800 tokens) context window
  • Added GLM-4.6 configuration to mainlandZAiModels with appropriate tiered pricing structure
  • Added comprehensive test coverage for GLM-4.6 model in both international and China API lines

Testing

  • ✅ All existing tests pass
  • ✅ New tests added for GLM-4.6 model verification
  • ✅ TypeScript compilation successful
  • ✅ Linting checks pass

Related Issue

Fixes #8406

Feedback and guidance are welcome!


Important

Adds support for GLM-4.6 model from Zhipu AI with 200k context window and tests for international and China API lines.

  • Behavior:
    • Adds GLM-4.6 model to internationalZAiModels and mainlandZAiModels with a 200k context window.
    • Configures tiered pricing for GLM-4.6 in mainlandZAiModels.
  • Testing:
    • Adds tests for GLM-4.6 in zai.spec.ts for both international and China API lines.
    • Verifies correct model configuration and context window size.
  • Misc:

This description was created by Ellipsis for dc549ee. You can customize this summary. It will automatically update as commits are pushed.

- Add GLM-4.6 configuration to internationalZAiModels with 200k context window
- Add GLM-4.6 configuration to mainlandZAiModels with tiered pricing
- Add test coverage for GLM-4.6 model in both international and China API lines

Fixes #8406
@roomote roomote bot requested review from cte, jr and mrubens as code owners September 30, 2025 09:06
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. Enhancement New feature or request labels Sep 30, 2025
Copy link
Contributor Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review protocol engaged: arguing with myself about GLM-4.6 so future-me doesn't bill at 200k twice.

cacheReadsPrice: 0.057,
},
{
contextWindow: 200_000,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] The 200_000 tier duplicates the Infinity tier pricing. Unless the provider bills differently at exactly 200k, this tier appears redundant and can be removed to reduce noise.

"GLM-4.5-Air is the lightweight version of GLM-4.5. It balances performance and cost-effectiveness, and can flexibly switch to hybrid thinking models.",
},
"glm-4.6": {
maxTokens: 98_304,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] Please confirm maxTokens for GLM-4.6. With a 204,800 context window, 98,304 mirrors the 4.5 configuration, but it may differ for 4.6 per provider docs.

const model = handlerWithModel.getModel()
expect(model.id).toBe(testModelId)
expect(model.info).toEqual(internationalZAiModels[testModelId])
expect(model.info.contextWindow).toBe(204_800)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] Consider asserting pricing and supportsPromptCache for GLM-4.6 (both intl and mainland) to catch future config regressions.

cacheWritesPrice: 0,
cacheReadsPrice: 0.11,
description:
"GLM-4.6 is Zhipu's newest model with an extended context window of up to 200k tokens, providing enhanced capabilities for processing longer documents and conversations.",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] Optional: add a link to the GLM-4.6 docs/announcement in this description for maintainers to verify context window and pricing quickly.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Sep 30, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 30, 2025
@mrubens mrubens merged commit 9e98d1a into main Sep 30, 2025
23 checks passed
@mrubens mrubens deleted the feat/add-glm-4.6-model branch September 30, 2025 13:26
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Sep 30, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Sep 30, 2025
brunobergher pushed a commit that referenced this pull request Oct 1, 2025
mini2s added a commit to zgsm-ai/costrict that referenced this pull request Oct 1, 2025
* chore(deps): update dependency eslint-config-prettier to v10.1.8 (RooCodeInc#6464)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency esbuild to v0.25.9 (RooCodeInc#5455)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency @changesets/cli to v2.29.6 (RooCodeInc#7376)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency nock to v14.0.10 (RooCodeInc#6465)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* chore(deps): update dependency eslint-plugin-turbo to v2.5.6 (RooCodeInc#7764)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* refactor(utils): simplify shell detection logic

* Merge remote-tracking branch 'upstream/main' into roo-to-main

* test: update shell detection test expectation and mocks

* test: add mock cleanup in shell detection tests

* test: update shell detection tests to prioritize PowerShell 7

* fix(workspace-event-monitor): increase max retries and improve retry logic

* refactor(codebase): improve error handling and workspace validation

* Revert PR RooCodeInc#7188 - Restore temperature parameter to fix TabbyApi/ExLlamaV2 crashes (RooCodeInc#7594)

* fix: reduce CodeBlock button z-index to prevent overlap with popovers (RooCodeInc#7783)

Fixes RooCodeInc#7703 - CodeBlock language dropdown and copy button were appearing above popovers due to z-index: 100. Reduced to z-index: 40 to maintain proper layering hierarchy while keeping buttons functional.

* Make ollama models info transport work like lmstudio (RooCodeInc#7679)

* feat: add click-to-edit, ESC-to-cancel, and fix padding consistency for chat messages (RooCodeInc#7790)

* feat: add click-to-edit, ESC-to-cancel, and fix padding consistency

- Enable click-to-edit for past messages by making message text clickable
- Add ESC key handler to cancel edit mode in ChatTextArea
- Fix padding consistency between past and queued message editors
- Adjust right padding for edit mode to accommodate cancel button

Fixes RooCodeInc#7788

* fix: adjust padding and layout for ChatTextArea in edit mode

* refactor: replace hardcoded pr-[72px] with standard Tailwind pr-20 class

---------

Co-authored-by: Roo Code <[email protected]>
Co-authored-by: Hannes Rudolph <[email protected]>
Co-authored-by: daniel-lxs <[email protected]>

* Let people paste in the auth redirect url (RooCodeInc#7805)

Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
Co-authored-by: Bruno Bergher <[email protected]>

* test: change console.error to console.warn in tests

* fix: resolve chat message edit/delete duplication issues (RooCodeInc#7793)

* fix: add GIT_EDITOR env var to merge-resolver mode for non-interactive rebase (RooCodeInc#7819)

* UI: Render reasoning as plain italic (match <thinking>) (RooCodeInc#7752)

Co-authored-by: Roo Code <[email protected]>
Co-authored-by: Hannes Rudolph <[email protected]>
Co-authored-by: daniel-lxs <[email protected]>

* Add taskSyncEnabled to userSettingsConfigSchema (RooCodeInc#7827)

feat: add taskSyncEnabled to userSettingsConfigSchema

Co-authored-by: Roo Code <[email protected]>

* Release: v1.75.0 (RooCodeInc#7829)

chore: bump version to v1.75.0

* fix: prevent negative cost values and improve label visibility in evals chart (RooCodeInc#7830)

Co-authored-by: Roo Code <[email protected]>

* Fix Groq context window display (RooCodeInc#7839)

* test: enhance vscode mock implementations and error handling

* feat(chat): replace edit button with copy functionality

* refactor(core): enhance binary file detection and encoding handling

* separate task sync roomote control (RooCodeInc#7799)

* feat: separate Task Sync and Roomote Control settings

- Add new taskSyncEnabled setting to control task content syncing
- Keep remoteControlEnabled for Roomote Control functionality
- Task Sync controls whether task content is sent to cloud
- Roomote Control controls whether cloud can send instructions back
- Roomote Control now depends on Task Sync being enabled
- Usage metrics (tokens, cost) always reported regardless of settings
- Update UI with two separate toggles and clear descriptions
- Add info text explaining usage metrics are always reported

* feat: add missing translations for Task Sync and Roomote Control settings

- Added taskSync, taskSyncDescription, remoteControlRequiresTaskSync, and usageMetricsAlwaysReported keys to all non-English cloud.json files
- Updated cloudBenefit keys to match English structure
- Ensured all languages have consistent translation keys for the new Task Sync and Roomote Control features

* Cloud: cleanup taskSyncEnabled additions

* fix: correct indentation localization files

---------

Co-authored-by: Roo Code <[email protected]>

* feat: In-extension dismissible upsells for Roo Code Cloud (RooCodeInc#7850)

* First pass at separate upsell dialog

* Revert PR RooCodeInc#7188 - Restore temperature parameter to fix TabbyApi/ExLlamaV2 crashes (RooCodeInc#7594)

* fix: reduce CodeBlock button z-index to prevent overlap with popovers (RooCodeInc#7783)

Fixes RooCodeInc#7703 - CodeBlock language dropdown and copy button were appearing above popovers due to z-index: 100. Reduced to z-index: 40 to maintain proper layering hierarchy while keeping buttons functional.

* Make ollama models info transport work like lmstudio (RooCodeInc#7679)

* feat: add click-to-edit, ESC-to-cancel, and fix padding consistency for chat messages (RooCodeInc#7790)

* feat: add click-to-edit, ESC-to-cancel, and fix padding consistency

- Enable click-to-edit for past messages by making message text clickable
- Add ESC key handler to cancel edit mode in ChatTextArea
- Fix padding consistency between past and queued message editors
- Adjust right padding for edit mode to accommodate cancel button

Fixes RooCodeInc#7788

* fix: adjust padding and layout for ChatTextArea in edit mode

* refactor: replace hardcoded pr-[72px] with standard Tailwind pr-20 class

---------

Co-authored-by: Roo Code <[email protected]>
Co-authored-by: Hannes Rudolph <[email protected]>
Co-authored-by: daniel-lxs <[email protected]>

* Let people paste in the auth redirect url (RooCodeInc#7805)

Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
Co-authored-by: Bruno B