From 50a87ba0949bcd9d6d506db224b16370cedfc757 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Tue, 30 Sep 2025 15:59:59 +0000 Subject: [PATCH] fix(zai): align with ModelInfo schema; remove owned_by fields; relax ZAiHandler generic to string to satisfy Record constraint --- packages/types/src/providers/zai.ts | 9 --------- src/api/providers/zai.ts | 2 +- tmp/Roo-Code | 1 + tmp/Roo-Code-rc | 1 + 4 files changed, 3 insertions(+), 10 deletions(-) create mode 160000 tmp/Roo-Code create mode 160000 tmp/Roo-Code-rc diff --git a/packages/types/src/providers/zai.ts b/packages/types/src/providers/zai.ts index dd066cd6d9..cd26afabb8 100644 --- a/packages/types/src/providers/zai.ts +++ b/packages/types/src/providers/zai.ts @@ -19,7 +19,6 @@ export const internationalZAiModels = { cacheReadsPrice: 0.11, description: "GLM-4.5 is Zhipu's latest featured model. Its comprehensive capabilities in reasoning, coding, and agent reach the state-of-the-art (SOTA) level among open-source models, with a context length of up to 128k.", - owned_by: "zai", }, "glm-4.6": { maxTokens: 98_304, @@ -32,7 +31,6 @@ export const internationalZAiModels = { 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.", - owned_by: "zai", }, "glm-4.5v": { maxTokens: 16_384, @@ -44,7 +42,6 @@ export const internationalZAiModels = { cacheWritesPrice: 0, cacheReadsPrice: 0.11, description: "GLM-4.5V is Zhipu's new generation of visual reasoning models based on the MOE architecture.", - owned_by: "zai", }, "glm-4.5-x": { maxTokens: 98_304, @@ -56,7 +53,6 @@ export const internationalZAiModels = { cacheWritesPrice: 0, cacheReadsPrice: 0.45, description: "GLM-4.5-X is the extended version with enhanced capabilities and performance for complex tasks.", - owned_by: "zai", }, "glm-4.5-air": { maxTokens: 98_304, @@ -69,7 +65,6 @@ export const internationalZAiModels = { cacheReadsPrice: 0.03, description: "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.", - owned_by: "zai", }, "glm-4.6-air": { maxTokens: 98_304, @@ -82,7 +77,6 @@ export const internationalZAiModels = { cacheReadsPrice: 0.03, description: "GLM-4.6-Air is the lightweight version of GLM-4.6. It balances performance and cost-effectiveness, and can flexibly switch to hybrid thinking models.", - owned_by: "zai", }, "glm-4.5-airx": { maxTokens: 98_304, @@ -94,7 +88,6 @@ export const internationalZAiModels = { cacheWritesPrice: 0, cacheReadsPrice: 0.22, description: "GLM-4.5-AirX is the extended version of GLM-4.5-Air with enhanced capabilities.", - owned_by: "zai", }, "glm-4-32b-0414-128k": { maxTokens: 98_304, @@ -106,7 +99,6 @@ export const internationalZAiModels = { cacheWritesPrice: 0, cacheReadsPrice: 0, description: "GLM-4-32B is a 32 billion parameter model with 128k context length, optimized for efficiency.", - owned_by: "zai", }, "glm-4.5-flash": { maxTokens: 98_304, @@ -118,7 +110,6 @@ export const internationalZAiModels = { cacheWritesPrice: 0, cacheReadsPrice: 0, description: "Zhipu's most advanced free model to date.", - owned_by: "zai", }, } as const satisfies Record diff --git a/src/api/providers/zai.ts b/src/api/providers/zai.ts index ce5aab9dd9..fffa0aab69 100644 --- a/src/api/providers/zai.ts +++ b/src/api/providers/zai.ts @@ -13,7 +13,7 @@ import type { ApiHandlerOptions } from "../../shared/api" import { BaseOpenAiCompatibleProvider } from "./base-openai-compatible-provider" -export class ZAiHandler extends BaseOpenAiCompatibleProvider { +export class ZAiHandler extends BaseOpenAiCompatibleProvider { constructor(options: ApiHandlerOptions) { const isChina = zaiApiLineConfigs[options.zaiApiLine ?? "international_coding"].isChina const models = isChina ? mainlandZAiModels : internationalZAiModels diff --git a/tmp/Roo-Code b/tmp/Roo-Code new file mode 160000 index 0000000000..8111da66bd --- /dev/null +++ b/tmp/Roo-Code @@ -0,0 +1 @@ +Subproject commit 8111da66bd59ca8d500e5eae23b24a0419ed7345 diff --git a/tmp/Roo-Code-rc b/tmp/Roo-Code-rc new file mode 160000 index 0000000000..7b7bb49572 --- /dev/null +++ b/tmp/Roo-Code-rc @@ -0,0 +1 @@ +Subproject commit 7b7bb49572975c4aeff2381a0ebea99b3aa4542c