From f3572c10e40c3606376f263de5157fe306cce753 Mon Sep 17 00:00:00 2001 From: default-cybe <201046277+default-cybe@users.noreply.github.com> Date: Tue, 24 Nov 2026 09:51:13 -0800 Subject: [PATCH] Add GLM-5.4 to the Z.ai Coding Plan models GLM-5.4 (docs.z.ai/guides/llm/glm-5.4): 1M context, 128K output, image and video input. It is on the Coding Plan only and has no API price yet, so it carries GLM-5.3's list prices. It becomes the deep GLM; GLM-5.3 moves to smart. Committed-by: Conclave (cliproxy/personal-claude/claude-opus-5-5) --- packages/core/src/config/schema.ts | 2 +- packages/core/src/providers/catalog.ts | 4 +++- packages/core/src/providers/registry.ts | 2 +- packages/core/test/config/zai-wire.test.ts | 2 +- packages/core/test/extensions/agent-profiles.test.ts | 4 ++-- packages/core/test/providers/catalog.test.ts | 2 +- packages/core/test/providers/registry.test.ts | 2 +- 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/core/src/config/schema.ts b/packages/core/src/config/schema.ts index 85313980d..9049e3531 100644 --- a/packages/core/src/config/schema.ts +++ b/packages/core/src/config/schema.ts @@ -856,7 +856,7 @@ export const DEFAULT_CONFIG: ConclaveConfig = { apiKeyEnv: 'ZAI_API_KEY', subscription: 'zai-coding', // the Coding Plan's models, newest first (the first one tests the key); keep in step with providers/catalog.ts - models: ['glm-5.3', 'glm-5.2', 'glm-5.1', 'glm-5', 'glm-5.3-flash', 'glm-4.7', 'glm-4.5-air'], + models: ['glm-5.4', 'glm-5.3', 'glm-5.2', 'glm-5.1', 'glm-5', 'glm-5.3-flash', 'glm-4.7', 'glm-4.5-air'], }, openrouter: { type: 'openai', baseUrl: 'https://openrouter.ai/api/v1', apiKeyEnv: 'OPENROUTER_API_KEY' }, ollama: { type: 'openai', name: 'Ollama', baseUrl: 'http://127.0.0.1:11434/v1', apiKey: 'ollama', enabled: false }, diff --git a/packages/core/src/providers/catalog.ts b/packages/core/src/providers/catalog.ts index 832710ebe..aaa7e1aa3 100644 --- a/packages/core/src/providers/catalog.ts +++ b/packages/core/src/providers/catalog.ts @@ -125,7 +125,9 @@ export const CATALOG: CatalogEntry[] = [ e('gemini', 'gemini-2.5-flash', 'Gemini 2.5 Flash', 1_048_576, 65_536, 'vtr', [0.3, 2.5, 0.03, 0], 'fast'), // Z.ai GLM (API list prices; the coding plan is a flat subscription). - e('zai', 'glm-5.3', 'GLM-5.3', M, 128 * K, 'tr', [1.4, 4.4, 0.26, 0], 'deep'), + // docs.z.ai/guides/llm/glm-5.4 (2026-11-24): 1M context, 128K output, image and video input; Coding Plan only, no API price yet, so GLM-5.3's. + e('zai', 'glm-5.4', 'GLM-5.4', M, 128 * K, 'vtr', [1.4, 4.4, 0.26, 0], 'deep'), + e('zai', 'glm-5.3', 'GLM-5.3', M, 128 * K, 'tr', [1.4, 4.4, 0.26, 0], 'smart'), e('zai', 'glm-5.2', 'GLM-5.2', M, 128 * K, 'tr', [1.4, 4.4, 0.26, 0], 'smart'), e('zai', 'glm-5.1', 'GLM-5.1', 200 * K, 128 * K, 'tr', [1.4, 4.4, 0.26, 0], 'smart'), e('zai', 'glm-5', 'GLM-5', 200 * K, 128 * K, 'tr', [1, 3.2, 0.2, 0], 'smart'), diff --git a/packages/core/src/providers/registry.ts b/packages/core/src/providers/registry.ts index 489957e19..2b9ee594c 100644 --- a/packages/core/src/providers/registry.ts +++ b/packages/core/src/providers/registry.ts @@ -90,7 +90,7 @@ const CLAUDE_ALIASES: Record = { }; /** Preference order for the "deep" alias. */ -const DEEP_ORDER = ['claude-opus-5-5', 'gpt-5.5', 'gemini-3.1-pro-preview', 'glm-5.3', 'kimi-k3', 'deepseek-v4-pro', 'qwen3.8-max']; +const DEEP_ORDER = ['claude-opus-5-5', 'gpt-5.5', 'gemini-3.1-pro-preview', 'glm-5.4', 'glm-5.3', 'kimi-k3', 'deepseek-v4-pro', 'qwen3.8-max']; /** Default provider ids that should win when several serve the same family. */ const FAMILY_HOME: Partial> = { anthropic: 'anthropic', openai: 'openai', gemini: 'google', zai: 'zai' }; diff --git a/packages/core/test/config/zai-wire.test.ts b/packages/core/test/config/zai-wire.test.ts index cd5138640..9f2e7f36b 100644 --- a/packages/core/test/config/zai-wire.test.ts +++ b/packages/core/test/config/zai-wire.test.ts @@ -48,7 +48,7 @@ describe('providers.zai moves to Chat Completions at /api/coding/paas/v4', () => test('an empty file loads the new default', () => { const { config } = store(undefined); expect(config.get().providers.zai).toMatchObject({ type: 'openai', baseUrl: 'https://api.z.ai/api/coding/paas/v4', apiKeyEnv: 'ZAI_API_KEY' }); - expect(config.get().providers.zai.models?.[0]).toBe('glm-5.3'); + expect(config.get().providers.zai.models?.[0]).toBe('glm-5.4'); }); test('the move runs on load only: a later update or replace back to the shim stays', () => { diff --git a/packages/core/test/extensions/agent-profiles.test.ts b/packages/core/test/extensions/agent-profiles.test.ts index 224689816..609956e61 100644 --- a/packages/core/test/extensions/agent-profiles.test.ts +++ b/packages/core/test/extensions/agent-profiles.test.ts @@ -115,8 +115,8 @@ describe('model tiers resolve per session', () => { }); test('a provider that lists models offers its first listed deep one', () => { - const h = host({ providers: { z: { type: 'openai', baseUrl: 'https://api.z.ai/api/paas/v4', apiKey: 'k', models: ['glm-4.6', 'glm-5.3'] } } as never, defaultModel: 'z/glm-4.6' }); - expect(deepTierModel(h, 'z/glm-4.6')).toBe('z/glm-5.3'); + const h = host({ providers: { z: { type: 'openai', baseUrl: 'https://api.z.ai/api/paas/v4', apiKey: 'k', models: ['glm-4.6', 'glm-5.4'] } } as never, defaultModel: 'z/glm-4.6' }); + expect(deepTierModel(h, 'z/glm-4.6')).toBe('z/glm-5.4'); }); test('models.tiers wins; fast is smallModel; smart is the session model', () => { diff --git a/packages/core/test/providers/catalog.test.ts b/packages/core/test/providers/catalog.test.ts index 2d2c182b1..3229e0284 100644 --- a/packages/core/test/providers/catalog.test.ts +++ b/packages/core/test/providers/catalog.test.ts @@ -56,7 +56,7 @@ describe('normalizeModelId and fuzzy lookup', () => { test('another model on a catalog name (a custom provider fine-tune) keeps its name and capabilities, not the vendor price', () => { const custom = new OpenAIProvider({ id: 'experientiallabs', config: { type: 'openai', baseUrl: 'https://api.experientiallabs.ai/v1' }, apiKey: 'k' }); const glm = custom.model('glm-5.3-uncensored'); - expect(glm).toMatchObject({ name: 'GLM-5.3 Uncensored', inputPrice: 0, outputPrice: 0, cacheReadPrice: 0, contextWindow: 1_000_000, tools: true, thinking: true, tier: 'deep' }); + expect(glm).toMatchObject({ name: 'GLM-5.3 Uncensored', inputPrice: 0, outputPrice: 0, cacheReadPrice: 0, contextWindow: 1_000_000, tools: true, thinking: true, tier: 'smart' }); expect(findCatalogEntry('glm-5.3-uncensored')?.family).toBe('zai'); // nor its vision: the vendor's Flash reads images, this build's route may not (a 400 "accepts text only") expect(custom.model('glm-5.3-flash-uncensored')).toMatchObject({ name: 'GLM-5.3 Flash Uncensored', inputPrice: 0, vision: false }); diff --git a/packages/core/test/providers/registry.test.ts b/packages/core/test/providers/registry.test.ts index 1d1f93536..339b3df0b 100644 --- a/packages/core/test/providers/registry.test.ts +++ b/packages/core/test/providers/registry.test.ts @@ -129,7 +129,7 @@ describe('ProviderRegistry.groups, costOf, test', () => { expect(by.openai.configured).toBe(true); expect(by.openai.models.some((m) => m.id === 'gpt-5.5')).toBe(true); - expect(by.zai.models.map((m) => m.id)).toEqual(['glm-5.3', 'glm-5.2', 'glm-5.1', 'glm-5', 'glm-5.3-flash', 'glm-4.7', 'glm-4.5-air']); + expect(by.zai.models.map((m) => m.id)).toEqual(['glm-5.4', 'glm-5.3', 'glm-5.2', 'glm-5.1', 'glm-5', 'glm-5.3-flash', 'glm-4.7', 'glm-4.5-air']); expect(by.ollama.enabled).toBe(false); expect(by['claude-code'].type).toBe('acp'); expect(by['claude-code'].models.map((m) => m.id)).toEqual(['default', 'opus', 'sonnet', 'haiku']);