@@ -362,6 +362,38 @@ describe('AgentBlockHandler', () => {
362362 } )
363363 } )
364364
365+ it ( 'keeps the Fireworks deployment separate from the catalog billing model' , async ( ) => {
366+ mockContext . userId = 'super-user'
367+ mockExecuteProviderRequest . mockResolvedValue ( {
368+ content : 'On-demand response' ,
369+ model : 'fireworks/qwen3.7-max' ,
370+ tokens : { input : 100 , output : 20 , total : 120 } ,
371+ } )
372+
373+ await handler . execute ( mockContext , mockBlock , {
374+ model : CUSTOM_MODEL_ID ,
375+ customModelConfig : {
376+ provider : 'fireworks' ,
377+ model : 'fireworks/qwen3.7-max' ,
378+ deployment : 'accounts/acme/deployments/qwen-prod' ,
379+ credentials : { mode : 'explicit' , apiKey : 'fw-secret' } ,
380+ } ,
381+ userPrompt : 'Hello' ,
382+ } )
383+
384+ expect ( mockExecuteProviderRequest ) . toHaveBeenCalledWith (
385+ 'fireworks' ,
386+ expect . objectContaining ( {
387+ model : 'fireworks/qwen3.7-max' ,
388+ providerModel : 'accounts/acme/deployments/qwen-prod' ,
389+ apiKey : 'fw-secret' ,
390+ credentialMode : 'explicit' ,
391+ capabilityPolicy : 'passthrough' ,
392+ } ) ,
393+ expect . anything ( )
394+ )
395+ } )
396+
365397 it ( 'rejects custom model execution when Super User mode is off' , async ( ) => {
366398 mockContext . userId = 'admin-with-toggle-off'
367399 mockVerifyEffectiveSuperUser . mockResolvedValue ( {
0 commit comments