@@ -184,10 +184,16 @@ describe('Fireworks deployment routing', () => {
184184 expect ( fetchCalls ) . toEqual ( [ KIMI_STANDARD_MODEL_ID ] )
185185 } )
186186
187- it ( 'keeps Kimi unavailable outside hours when no deployment is mapped' , async ( ) => {
188- const mockFetch = mock ( async ( ) => {
189- throw new Error ( 'should not fetch outside deployment hours' )
190- } ) as unknown as typeof globalThis . fetch
187+ it ( 'uses serverless API for Kimi outside deployment hours (Kimi is 24/7)' , async ( ) => {
188+ const fetchCalls : string [ ] = [ ]
189+
190+ const mockFetch = mock (
191+ async ( _url : string | URL | Request , init ?: RequestInit ) => {
192+ const body = JSON . parse ( init ?. body as string )
193+ fetchCalls . push ( body . model )
194+ return new Response ( JSON . stringify ( { ok : true } ) , { status : 200 } )
195+ } ,
196+ ) as unknown as typeof globalThis . fetch
191197
192198 const response = await createFireworksRequestWithFallback ( {
193199 body : kimiBody as never ,
@@ -202,9 +208,8 @@ describe('Fireworks deployment routing', () => {
202208 now : BEFORE_DEPLOYMENT_HOURS ,
203209 } )
204210
205- expect ( response . status ) . toBe ( 503 )
206- const body = await response . json ( )
207- expect ( body . error . code ) . toBe ( 'DEPLOYMENT_OUTSIDE_HOURS' )
211+ expect ( response . status ) . toBe ( 200 )
212+ expect ( fetchCalls ) . toEqual ( [ KIMI_STANDARD_MODEL_ID ] )
208213 } )
209214
210215 it ( 'keeps GLM unavailable outside hours when no deployment is mapped' , async ( ) => {
@@ -433,7 +438,7 @@ describe('Fireworks deployment routing', () => {
433438 expect ( body . error . code ) . toBe ( 'DEPLOYMENT_OUTSIDE_HOURS' )
434439 } )
435440
436- it ( 'falls back to the standard Fireworks API for Kimi lite mode outside deployment hours' , async ( ) => {
441+ it ( 'uses the standard Fireworks API for Kimi lite mode outside deployment hours' , async ( ) => {
437442 const fetchCalls : string [ ] = [ ]
438443
439444 const mockFetch = mock (
0 commit comments