@@ -76,8 +76,13 @@ vi.mock("../../R1FormatSetting", () => ({
7676 R1FormatSetting : ( ) => < div data-testid = "r1-format-setting" > R1 Format Setting</ div > ,
7777} ) )
7878
79+ const { mockThinkingBudget } = vi . hoisted ( ( ) => ( { mockThinkingBudget : vi . fn ( ) } ) )
80+
7981vi . mock ( "../../ThinkingBudget" , ( ) => ( {
80- ThinkingBudget : ( ) => < div data-testid = "thinking-budget" > Thinking Budget</ div > ,
82+ ThinkingBudget : ( props : any ) => {
83+ mockThinkingBudget ( props )
84+ return < div data-testid = "thinking-budget" > Thinking Budget</ div >
85+ } ,
8186} ) )
8287
8388// Mock react-use
@@ -312,4 +317,39 @@ describe("OpenAICompatible Component - includeMaxTokens checkbox", () => {
312317 expect ( description ) . toHaveClass ( "text-sm" , "text-vscode-descriptionForeground" , "ml-6" )
313318 } )
314319 } )
320+ describe ( "reasoning effort" , ( ) => {
321+ it ( "should expose and persist the max reasoning-effort value" , ( ) => {
322+ const apiConfiguration : Partial < ProviderSettings > = {
323+ enableReasoningEffort : true ,
324+ openAiCustomModelInfo : {
325+ contextWindow : 128_000 ,
326+ supportsPromptCache : false ,
327+ } ,
328+ }
329+
330+ render (
331+ < OpenAICompatible
332+ apiConfiguration = { apiConfiguration as ProviderSettings }
333+ setApiConfigurationField = { mockSetApiConfigurationField }
334+ organizationAllowList = { mockOrganizationAllowList }
335+ /> ,
336+ )
337+
338+ const thinkingBudgetProps = mockThinkingBudget . mock . calls [ 0 ] [ 0 ]
339+ expect ( thinkingBudgetProps . modelInfo . supportsReasoningEffort ) . toEqual ( [
340+ "low" ,
341+ "medium" ,
342+ "high" ,
343+ "xhigh" ,
344+ "max" ,
345+ ] )
346+
347+ thinkingBudgetProps . setApiConfigurationField ( "reasoningEffort" , "max" )
348+
349+ expect ( mockSetApiConfigurationField ) . toHaveBeenCalledWith ( "openAiCustomModelInfo" , {
350+ ...apiConfiguration . openAiCustomModelInfo ,
351+ reasoningEffort : "max" ,
352+ } )
353+ } )
354+ } )
315355} )
0 commit comments