@@ -42,7 +42,7 @@ describe('GLM Provider Integration', () => {
4242 const providerService = new ProviderService ( ) ;
4343
4444 // GLM models start with "glm-"
45- expect ( providerService . isGlmModel ( 'glm-4.7 ' ) ) . toBe ( true ) ;
45+ expect ( providerService . isGlmModel ( 'glm-5 ' ) ) . toBe ( true ) ;
4646 expect ( providerService . isGlmModel ( 'glm-4' ) ) . toBe ( true ) ;
4747 expect ( providerService . isGlmModel ( 'GLM-4.7' ) ) . toBe ( true ) ; // case insensitive
4848
@@ -56,7 +56,7 @@ describe('GLM Provider Integration', () => {
5656 it ( 'should detect provider from model ID' , ( ) => {
5757 const providerService = new ProviderService ( ) ;
5858
59- expect ( providerService . detectProviderFromModel ( 'glm-4.7 ' ) ) . toBe ( 'glm' ) ;
59+ expect ( providerService . detectProviderFromModel ( 'glm-5 ' ) ) . toBe ( 'glm' ) ;
6060 expect ( providerService . detectProviderFromModel ( 'GLM-4' ) ) . toBe ( 'glm' ) ;
6161 expect ( providerService . detectProviderFromModel ( 'default' ) ) . toBe ( 'anthropic' ) ;
6262 expect ( providerService . detectProviderFromModel ( 'opus' ) ) . toBe ( 'anthropic' ) ;
@@ -70,7 +70,7 @@ describe('GLM Provider Integration', () => {
7070 process . env . GLM_API_KEY = 'test-glm-api-key' ;
7171
7272 try {
73- const envVars = providerService . getEnvVarsForModel ( 'glm-4.7 ' ) ;
73+ const envVars = providerService . getEnvVarsForModel ( 'glm-5 ' ) ;
7474
7575 // Verify all required env vars are set
7676 expect ( envVars . ANTHROPIC_BASE_URL ) . toBe ( 'https://open.bigmodel.cn/api/anthropic' ) ;
@@ -83,10 +83,10 @@ describe('GLM Provider Integration', () => {
8383 expect ( envVars . CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC ) . toBe ( '1' ) ;
8484 // API_TIMEOUT_MS is set for GLM (50 minutes)
8585 expect ( envVars . API_TIMEOUT_MS ) . toBe ( '3000000' ) ;
86- // Model mapping should be set (glm-4.7 maps to all tiers)
87- expect ( envVars . ANTHROPIC_DEFAULT_HAIKU_MODEL ) . toBe ( 'glm-4.7 ' ) ;
88- expect ( envVars . ANTHROPIC_DEFAULT_SONNET_MODEL ) . toBe ( 'glm-4.7 ' ) ;
89- expect ( envVars . ANTHROPIC_DEFAULT_OPUS_MODEL ) . toBe ( 'glm-4.7 ' ) ;
86+ // Model mapping should be set (glm-5 maps to all tiers)
87+ expect ( envVars . ANTHROPIC_DEFAULT_HAIKU_MODEL ) . toBe ( 'glm-5 ' ) ;
88+ expect ( envVars . ANTHROPIC_DEFAULT_SONNET_MODEL ) . toBe ( 'glm-5 ' ) ;
89+ expect ( envVars . ANTHROPIC_DEFAULT_OPUS_MODEL ) . toBe ( 'glm-5 ' ) ;
9090 } finally {
9191 if ( originalGlmKey !== undefined ) {
9292 process . env . GLM_API_KEY = originalGlmKey ;
@@ -96,15 +96,15 @@ describe('GLM Provider Integration', () => {
9696 }
9797 } ) ;
9898
99- it ( 'should return correct env vars for glm-4.7 ' , ( ) => {
99+ it ( 'should return correct env vars for glm-5 ' , ( ) => {
100100 const providerService = new ProviderService ( ) ;
101101
102102 // Mock GLM_API_KEY
103103 const originalGlmKey = process . env . GLM_API_KEY ;
104104 process . env . GLM_API_KEY = 'test-glm-api-key' ;
105105
106106 try {
107- const envVars = providerService . getEnvVarsForModel ( 'glm-4.7 ' ) ;
107+ const envVars = providerService . getEnvVarsForModel ( 'glm-5 ' ) ;
108108
109109 // Verify base env vars are set
110110 expect ( envVars . ANTHROPIC_BASE_URL ) . toBe ( 'https://open.bigmodel.cn/api/anthropic' ) ;
@@ -114,10 +114,10 @@ describe('GLM Provider Integration', () => {
114114 expect ( envVars . ANTHROPIC_API_KEY ) . toBeUndefined ( ) ;
115115 // ANTHROPIC_MODEL is NOT set - model ID is passed directly to SDK
116116 expect ( envVars . ANTHROPIC_MODEL ) . toBeUndefined ( ) ;
117- // All tiers map to glm-4.7
118- expect ( envVars . ANTHROPIC_DEFAULT_HAIKU_MODEL ) . toBe ( 'glm-4.7 ' ) ;
119- expect ( envVars . ANTHROPIC_DEFAULT_SONNET_MODEL ) . toBe ( 'glm-4.7 ' ) ;
120- expect ( envVars . ANTHROPIC_DEFAULT_OPUS_MODEL ) . toBe ( 'glm-4.7 ' ) ;
117+ // All tiers map to glm-5
118+ expect ( envVars . ANTHROPIC_DEFAULT_HAIKU_MODEL ) . toBe ( 'glm-5 ' ) ;
119+ expect ( envVars . ANTHROPIC_DEFAULT_SONNET_MODEL ) . toBe ( 'glm-5 ' ) ;
120+ expect ( envVars . ANTHROPIC_DEFAULT_OPUS_MODEL ) . toBe ( 'glm-5 ' ) ;
121121 // Extended timeout
122122 expect ( envVars . API_TIMEOUT_MS ) . toBe ( '3000000' ) ;
123123 } finally {
@@ -189,7 +189,7 @@ describe('GLM Provider Integration', () => {
189189 const providerService = new ProviderService ( ) ;
190190
191191 expect ( await providerService . getDefaultModelForProvider ( 'anthropic' ) ) . toBe ( 'default' ) ;
192- expect ( await providerService . getDefaultModelForProvider ( 'glm' ) ) . toBe ( 'glm-4.7 ' ) ;
192+ expect ( await providerService . getDefaultModelForProvider ( 'glm' ) ) . toBe ( 'glm-5 ' ) ;
193193 } ) ;
194194
195195 it ( 'should validate provider switch correctly' , async ( ) => {
@@ -260,9 +260,9 @@ describe('GLM Provider Integration', () => {
260260 } ,
261261 // GLM models are included when GLM_API_KEY is set
262262 {
263- id : 'glm-4.7 ' ,
263+ id : 'glm-5 ' ,
264264 name : 'GLM-4.7' ,
265- alias : 'glm-4.7 ' ,
265+ alias : 'glm-5 ' ,
266266 family : 'glm' as const ,
267267 provider : 'glm' ,
268268 contextWindow : 128000 ,
@@ -284,7 +284,7 @@ describe('GLM Provider Integration', () => {
284284 expect ( models . length ) . toBe ( 4 ) ;
285285
286286 // Find GLM model
287- const glmModel = models . find ( ( m ) => m . id === 'glm-4.7 ' ) ;
287+ const glmModel = models . find ( ( m ) => m . id === 'glm-5 ' ) ;
288288 expect ( glmModel ) . toBeDefined ( ) ;
289289 expect ( glmModel ! . name ) . toBe ( 'GLM-4.7' ) ;
290290 expect ( glmModel ! . family ) . toBe ( 'glm' ) ;
@@ -357,7 +357,7 @@ describe('GLM Provider Integration', () => {
357357 expect ( models . length ) . toBe ( 3 ) ;
358358
359359 // Should NOT have GLM model
360- const glmModel = models . find ( ( m ) => m . id === 'glm-4.7 ' ) ;
360+ const glmModel = models . find ( ( m ) => m . id === 'glm-5 ' ) ;
361361 expect ( glmModel ) . toBeUndefined ( ) ;
362362
363363 // Should have Anthropic models
@@ -394,9 +394,9 @@ describe('GLM Provider Integration', () => {
394394 description : 'Sonnet 4.5 · Best for everyday tasks' ,
395395 } ,
396396 {
397- id : 'glm-4.7 ' ,
397+ id : 'glm-5 ' ,
398398 name : 'GLM-4.7' ,
399- alias : 'glm-4.7 ' ,
399+ alias : 'glm-5 ' ,
400400 family : 'glm' as const ,
401401 provider : 'glm' ,
402402 contextWindow : 128000 ,
@@ -415,7 +415,7 @@ describe('GLM Provider Integration', () => {
415415 const models = getAvailableModels ( 'global' ) ;
416416
417417 // Should include GLM model
418- const glmModel = models . find ( ( m ) => m . id === 'glm-4.7 ' ) ;
418+ const glmModel = models . find ( ( m ) => m . id === 'glm-5 ' ) ;
419419 expect ( glmModel ) . toBeDefined ( ) ;
420420 expect ( glmModel ! . name ) . toBe ( 'GLM-4.7' ) ;
421421 expect ( glmModel ! . provider ) . toBe ( 'glm' ) ;
@@ -441,7 +441,7 @@ describe('GLM Provider Integration', () => {
441441 // Create session with GLM model (model-based detection, no provider config needed)
442442 const session = createTestSession ( env . testWorkspace , {
443443 config : {
444- model : 'glm-4.7 ' , // GLM model ID triggers env var injection
444+ model : 'glm-5 ' , // GLM model ID triggers env var injection
445445 } ,
446446 } ) ;
447447
@@ -459,7 +459,7 @@ describe('GLM Provider Integration', () => {
459459 expect ( options . env ) . toBeUndefined ( ) ;
460460
461461 // The model ID is translated to SDK-recognized ID
462- expect ( options . model ) . toBe ( 'default' ) ; // glm-4.7 → default (Sonnet tier)
462+ expect ( options . model ) . toBe ( 'default' ) ; // glm-5 → default (Sonnet tier)
463463 } finally {
464464 if ( originalGlmKey !== undefined ) {
465465 process . env . GLM_API_KEY = originalGlmKey ;
@@ -474,7 +474,7 @@ describe('GLM Provider Integration', () => {
474474
475475 const session = createTestSession ( env . testWorkspace , {
476476 config : {
477- model : 'glm-4.7 ' ,
477+ model : 'glm-5 ' ,
478478 env : {
479479 // API_TIMEOUT_MS is now filtered as provider-specific var
480480 // Provider env vars are managed by the provider system, not options.env
@@ -566,7 +566,7 @@ describe('GLM Provider Integration', () => {
566566 'anthropic-version' : '2023-06-01' ,
567567 } ,
568568 body : JSON . stringify ( {
569- model : 'glm-4.7 ' ,
569+ model : 'glm-5 ' ,
570570 max_tokens : 100 ,
571571 messages : [
572572 {
0 commit comments