@@ -369,4 +369,76 @@ describe("useSelectedModel", () => {
369369 expect ( result . current . info ) . toBeUndefined ( )
370370 } )
371371 } )
372+
373+ describe ( "claude-code provider" , ( ) => {
374+ it ( "should return claude-code model with supportsImages disabled" , ( ) => {
375+ mockUseRouterModels . mockReturnValue ( {
376+ data : {
377+ openrouter : { } ,
378+ requesty : { } ,
379+ glama : { } ,
380+ unbound : { } ,
381+ litellm : { } ,
382+ } ,
383+ isLoading : false ,
384+ isError : false ,
385+ } as any )
386+
387+ mockUseOpenRouterModelProviders . mockReturnValue ( {
388+ data : { } ,
389+ isLoading : false ,
390+ isError : false ,
391+ } as any )
392+
393+ const apiConfiguration : ProviderSettings = {
394+ apiProvider : "claude-code" ,
395+ apiModelId : "claude-sonnet-4-20250514" ,
396+ }
397+
398+ const wrapper = createWrapper ( )
399+ const { result } = renderHook ( ( ) => useSelectedModel ( apiConfiguration ) , { wrapper } )
400+
401+ expect ( result . current . provider ) . toBe ( "claude-code" )
402+ expect ( result . current . id ) . toBe ( "claude-sonnet-4-20250514" )
403+ expect ( result . current . info ) . toBeDefined ( )
404+ expect ( result . current . info ?. supportsImages ) . toBe ( false )
405+ expect ( result . current . info ?. supportsPromptCache ) . toBe ( false )
406+ // Verify it inherits other properties from anthropic models
407+ expect ( result . current . info ?. maxTokens ) . toBe ( 64_000 )
408+ expect ( result . current . info ?. contextWindow ) . toBe ( 200_000 )
409+ expect ( result . current . info ?. supportsComputerUse ) . toBe ( true )
410+ } )
411+
412+ it ( "should use default claude-code model when no modelId is specified" , ( ) => {
413+ mockUseRouterModels . mockReturnValue ( {
414+ data : {
415+ openrouter : { } ,
416+ requesty : { } ,
417+ glama : { } ,
418+ unbound : { } ,
419+ litellm : { } ,
420+ } ,
421+ isLoading : false ,
422+ isError : false ,
423+ } as any )
424+
425+ mockUseOpenRouterModelProviders . mockReturnValue ( {
426+ data : { } ,
427+ isLoading : false ,
428+ isError : false ,
429+ } as any )
430+
431+ const apiConfiguration : ProviderSettings = {
432+ apiProvider : "claude-code" ,
433+ }
434+
435+ const wrapper = createWrapper ( )
436+ const { result } = renderHook ( ( ) => useSelectedModel ( apiConfiguration ) , { wrapper } )
437+
438+ expect ( result . current . provider ) . toBe ( "claude-code" )
439+ expect ( result . current . id ) . toBe ( "claude-sonnet-4-20250514" ) // Default model
440+ expect ( result . current . info ) . toBeDefined ( )
441+ expect ( result . current . info ?. supportsImages ) . toBe ( false )
442+ } )
443+ } )
372444} )
0 commit comments