@@ -167,6 +167,31 @@ describe("ZAiHandler", () => {
167167 expect ( model . info . cacheReadsPrice ) . toBe ( 0.26 )
168168 } )
169169
170+ it ( "should expose multimodal GLM-5.3-Flash for the international Coding Plan" , ( ) => {
171+ const model = new ZAiHandler ( {
172+ apiModelId : "glm-5.3-flash" ,
173+ zaiApiKey : "test-zai-api-key" ,
174+ zaiApiLine : "international_coding" ,
175+ } ) . getModel ( )
176+
177+ expect ( model . id ) . toBe ( "glm-5.3-flash" )
178+ expect ( model . info ) . toMatchObject ( {
179+ contextWindow : 1_000_000 ,
180+ maxTokens : 131_072 ,
181+ supportsImages : true ,
182+ supportsPromptCache : true ,
183+ supportsMaxTokens : true ,
184+ supportsReasoningEffort : [ "low" , "high" , "max" ] ,
185+ requiredReasoningEffort : true ,
186+ reasoningEffort : "max" ,
187+ preserveReasoning : true ,
188+ defaultTemperature : 1 ,
189+ inputPrice : 0.15 ,
190+ outputPrice : 0.5 ,
191+ cacheReadsPrice : 0.03 ,
192+ } )
193+ } )
194+
170195 it ( "should return GLM-5-Turbo international model with thinking support" , ( ) => {
171196 const testModelId : InternationalZAiModelId = "glm-5-turbo"
172197 const handlerWithModel = new ZAiHandler ( {
@@ -319,6 +344,22 @@ describe("ZAiHandler", () => {
319344 expect ( model . info . cacheReadsPrice ) . toBe ( 0.13 )
320345 } )
321346
347+ it ( "should expose GLM-5.3-Flash for the China Coding Plan" , ( ) => {
348+ const model = new ZAiHandler ( {
349+ apiModelId : "glm-5.3-flash" ,
350+ zaiApiKey : "test-zai-api-key" ,
351+ zaiApiLine : "china_coding" ,
352+ } ) . getModel ( )
353+
354+ expect ( model . id ) . toBe ( "glm-5.3-flash" )
355+ expect ( model . info . supportsImages ) . toBe ( true )
356+ expect ( model . info . supportsReasoningEffort ) . toEqual ( [ "low" , "high" , "max" ] )
357+ expect ( model . info . requiredReasoningEffort ) . toBe ( true )
358+ expect ( model . info . inputPrice ) . toBe ( 0.075 )
359+ expect ( model . info . outputPrice ) . toBe ( 0.25 )
360+ expect ( model . info . cacheReadsPrice ) . toBe ( 0.015 )
361+ } )
362+
322363 it ( "should return GLM-4.7 China model with thinking support" , ( ) => {
323364 const testModelId : MainlandZAiModelId = "glm-4.7"
324365 const handlerWithModel = new ZAiHandler ( {
@@ -393,6 +434,7 @@ describe("ZAiHandler", () => {
393434
394435 it ( "should expose GLM-5.3 on the international API" , ( ) => {
395436 expect ( getZAiModels ( "international_api" ) ) . toHaveProperty ( "glm-5.3" )
437+ expect ( getZAiModels ( "international_api" ) ) . toHaveProperty ( "glm-5.3-flash" )
396438 const handlerWithModel = new ZAiHandler ( {
397439 apiModelId : "glm-5.3" ,
398440 zaiApiKey : "test-zai-api-key" ,
@@ -442,6 +484,7 @@ describe("ZAiHandler", () => {
442484
443485 it ( "should not expose Coding Plan-only models" , ( ) => {
444486 expect ( getZAiModels ( "china_api" ) ) . not . toHaveProperty ( "glm-5.3" )
487+ expect ( getZAiModels ( "china_api" ) ) . not . toHaveProperty ( "glm-5.3-flash" )
445488 } )
446489 } )
447490
@@ -692,6 +735,29 @@ describe("ZAiHandler", () => {
692735 )
693736 } )
694737
738+ it ( "should use the official GLM-5.3-Flash thinking and sampling defaults" , async ( ) => {
739+ const handlerWithModel = new ZAiHandler ( {
740+ apiModelId : "glm-5.3-flash" ,
741+ zaiApiKey : "test-zai-api-key" ,
742+ zaiApiLine : "international_coding" ,
743+ reasoningEffort : "disable" ,
744+ } )
745+
746+ mockCreate . mockImplementationOnce ( ( ) => asyncStreamFrom ( [ ] ) )
747+
748+ const messageGenerator = handlerWithModel . createMessage ( "system prompt" , [ ] )
749+ await messageGenerator . next ( )
750+
751+ expect ( mockCreate ) . toHaveBeenCalledWith (
752+ expect . objectContaining ( {
753+ model : "glm-5.3-flash" ,
754+ thinking : { type : "enabled" , clear_thinking : false } ,
755+ reasoning_effort : "max" ,
756+ temperature : 1 ,
757+ } ) ,
758+ )
759+ } )
760+
695761 it ( "should keep GLM-5.3 reasoning enabled when the master reasoning setting is disabled" , async ( ) => {
696762 const handlerWithModel = new ZAiHandler ( {
697763 apiModelId : "glm-5.3" ,
@@ -734,6 +800,26 @@ describe("ZAiHandler", () => {
734800 } )
735801 } )
736802
803+ it ( "should use the official GLM-5.3-Flash parameters for completePrompt" , async ( ) => {
804+ const handlerWithModel = new ZAiHandler ( {
805+ apiModelId : "glm-5.3-flash" ,
806+ zaiApiKey : "test-zai-api-key" ,
807+ zaiApiLine : "international_api" ,
808+ reasoningEffort : "low" ,
809+ } )
810+
811+ mockCreate . mockResolvedValueOnce ( { choices : [ { message : { content : "response" } } ] } )
812+
813+ await expect ( handlerWithModel . completePrompt ( "prompt" ) ) . resolves . toBe ( "response" )
814+ expect ( mockCreate ) . toHaveBeenCalledWith ( {
815+ model : "glm-5.3-flash" ,
816+ messages : [ { role : "user" , content : "prompt" } ] ,
817+ temperature : 1 ,
818+ thinking : { type : "enabled" , clear_thinking : false } ,
819+ reasoning_effort : "low" ,
820+ } )
821+ } )
822+
737823 it ( "should omit reasoning_effort for GLM-5.2 when reasoningEffort is set to disable" , async ( ) => {
738824 const handlerWithModel = new ZAiHandler ( {
739825 apiModelId : "glm-5.2" ,
0 commit comments