@@ -16,6 +16,35 @@ describe('getModelOptionsForFlavor', () => {
1616 expect ( options . some ( ( o ) => o . value === 'opus' ) ) . toBe ( true )
1717 } )
1818
19+ it ( 'keeps Claude presets when explicit options only include Sonnet models' , ( ) => {
20+ const options = getModelOptionsForFlavor ( 'claude' , null , [
21+ { value : null , label : 'Default' } ,
22+ { value : 'sonnet' , label : 'Sonnet' } ,
23+ { value : 'sonnet[1m]' , label : 'Sonnet 1M' }
24+ ] )
25+ expect ( options ) . toEqual ( [
26+ { value : null , label : 'Default' } ,
27+ { value : 'sonnet' , label : 'Sonnet' } ,
28+ { value : 'sonnet[1m]' , label : 'Sonnet 1M' } ,
29+ { value : 'opus' , label : 'Opus' } ,
30+ { value : 'opus[1m]' , label : 'Opus 1M' }
31+ ] )
32+ } )
33+
34+ it ( 'adds non-preset Claude options without hiding Opus presets' , ( ) => {
35+ const options = getModelOptionsForFlavor ( 'claude' , null , [
36+ { value : 'claude-opus-4-1-20250805' , label : 'Claude Opus 4.1' }
37+ ] )
38+ expect ( options ) . toEqual ( [
39+ { value : null , label : 'Default' } ,
40+ { value : 'claude-opus-4-1-20250805' , label : 'Claude Opus 4.1' } ,
41+ { value : 'sonnet' , label : 'Sonnet' } ,
42+ { value : 'sonnet[1m]' , label : 'Sonnet 1M' } ,
43+ { value : 'opus' , label : 'Opus' } ,
44+ { value : 'opus[1m]' , label : 'Opus 1M' }
45+ ] )
46+ } )
47+
1948 it ( 'includes custom Gemini model from env/config in options' , ( ) => {
2049 const options = getModelOptionsForFlavor ( 'gemini' , 'gemini-custom-experiment' )
2150 expect ( options . some ( ( o ) => o . value === 'gemini-custom-experiment' ) ) . toBe ( true )
@@ -94,6 +123,14 @@ describe('getNextModelForFlavor', () => {
94123 expect ( next ) . not . toBeNull ( )
95124 } )
96125
126+ it ( 'cycles through Claude presets when explicit options only include Sonnet models' , ( ) => {
127+ const next = getNextModelForFlavor ( 'claude' , 'sonnet[1m]' , [
128+ { value : 'sonnet' , label : 'Sonnet' } ,
129+ { value : 'sonnet[1m]' , label : 'Sonnet 1M' }
130+ ] )
131+ expect ( next ) . toBe ( 'opus' )
132+ } )
133+
97134 it ( 'cycles explicit model options' , ( ) => {
98135 const next = getNextModelForFlavor ( 'codex' , 'gpt-5.5' , [
99136 { value : 'gpt-5.5' , label : 'GPT-5.5' } ,
0 commit comments