File tree Expand file tree Collapse file tree
src/api/providers/__tests__ Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -266,6 +266,31 @@ describe("OpenAiNativeHandler", () => {
266266 } ,
267267 )
268268
269+ it ( "should omit the service tier when none is configured" , async ( ) => {
270+ mockResponsesCreate . mockResolvedValue ( { output : [ ] } )
271+
272+ await handler . completePrompt ( "Test prompt" )
273+
274+ const [ request ] = mockResponsesCreate . mock . calls [ 0 ]
275+ expect ( request . stream ) . toBe ( false )
276+ expect ( request ) . not . toHaveProperty ( SERVICE_TIER_KEY )
277+ } )
278+
279+ it ( "should omit a configured service tier that the model does not support" , async ( ) => {
280+ mockResponsesCreate . mockResolvedValue ( { output : [ ] } )
281+ handler = new OpenAiNativeHandler ( {
282+ ...mockOptions ,
283+ apiModelId : "gpt-5.6-luna" ,
284+ openAiNativeServiceTier : OpenAiServiceTier . Priority ,
285+ } )
286+
287+ await handler . completePrompt ( "Test prompt" )
288+
289+ const [ request ] = mockResponsesCreate . mock . calls [ 0 ]
290+ expect ( request . stream ) . toBe ( false )
291+ expect ( request ) . not . toHaveProperty ( SERVICE_TIER_KEY )
292+ } )
293+
269294 it ( "should handle SDK errors in completePrompt" , async ( ) => {
270295 // Mock SDK to throw an error
271296 mockResponsesCreate . mockRejectedValue ( new Error ( "API Error" ) )
You can’t perform that action at this time.
0 commit comments