@@ -16,62 +16,18 @@ import {
1616 PROVIDER_DEFINITIONS ,
1717 supportsForcedToolUse ,
1818 updateFireworksModels ,
19- updateOpenRouterModels ,
2019} from '@/providers/models'
2120import { supportsPromptCaching } from '@/providers/utils'
2221
2322describe ( 'forced tool use capability' , ( ) => {
24- it ( 'keeps Auto and None support when a model disables Force' , ( ) => {
25- expect ( getModelCapabilities ( 'claude-fable-5-1' ) ) . toMatchObject ( {
26- toolUsageControl : true ,
27- forcedToolUse : false ,
28- } )
29- } )
30-
31- it . each ( [
32- 'claude-fable-5-1' ,
33- 'CLAUDE-FABLE-5-1-20260901' ,
34- 'azure-anthropic/claude-fable-5-1' ,
35- 'azure-anthropic/claude-fable-5-1-20260901' ,
36- 'bedrock/anthropic.claude-fable-5-1-v1:0' ,
37- 'claude-mythos-5-1' ,
38- 'claude-mythos-5-1-20260901' ,
39- ] ) ( 'disables forced tool use for %s' , ( model ) => {
40- expect ( getModelCapabilities ( model ) ) . toMatchObject ( {
41- toolUsageControl : true ,
42- forcedToolUse : false ,
43- } )
44- expect ( supportsForcedToolUse ( model ) ) . toBe ( false )
45- } )
46-
47- it ( 'adds only known alias capabilities to provider defaults' , ( ) => {
48- expect ( getModelCapabilities ( 'claude-mythos-5-1' ) ) . toEqual ( {
49- ...PROVIDER_DEFINITIONS . anthropic . capabilities ,
50- forcedToolUse : false ,
51- } )
52- } )
53-
54- it ( 'inherits alias capabilities for dynamic models and respects explicit overrides' , ( ) => {
55- const originalModels = PROVIDER_DEFINITIONS . openrouter . models
56- const modelId = 'anthropic/claude-fable-5-1'
57- try {
58- updateOpenRouterModels ( [ modelId ] )
59- expect ( getModelCapabilities ( modelId ) ?. forcedToolUse ) . toBe ( false )
60- expect ( supportsForcedToolUse ( modelId ) ) . toBe ( false )
61-
62- PROVIDER_DEFINITIONS . openrouter . models [ 0 ] . capabilities . forcedToolUse = true
63- expect ( getModelCapabilities ( modelId ) ?. forcedToolUse ) . toBe ( true )
64- expect ( supportsForcedToolUse ( modelId ) ) . toBe ( true )
65- } finally {
66- PROVIDER_DEFINITIONS . openrouter . models = originalModels
67- }
68- } )
69-
70- it . each ( [ 'claude-fable-5-10' , 'claude-mythos-5-10' , 'claude-not-fable-5-1' ] ) (
71- 'does not apply alias restrictions to unrelated model %s' ,
23+ it . each ( [ 'claude-fable-5-1' , 'CLAUDE-FABLE-5-1' ] ) (
24+ 'disables Force while keeping Auto and None support for %s' ,
7225 ( model ) => {
73- expect ( getModelCapabilities ( model ) ) . toEqual ( PROVIDER_DEFINITIONS . anthropic . capabilities )
74- expect ( supportsForcedToolUse ( model ) ) . toBe ( true )
26+ expect ( getModelCapabilities ( model ) ) . toMatchObject ( {
27+ toolUsageControl : true ,
28+ forcedToolUse : false ,
29+ } )
30+ expect ( supportsForcedToolUse ( model ) ) . toBe ( false )
7531 }
7632 )
7733
0 commit comments