@@ -217,6 +217,24 @@ describe('ModelSelectorComponent', () => {
217217 expect ( onSelect ) . toHaveBeenLastCalledWith ( { alias : 'plain' , effort : 'off' } ) ;
218218 } ) ;
219219
220+ it ( 'keeps the live effort when switching to another model instead of resetting to its first level' , ( ) => {
221+ const onSelect = vi . fn ( ) ;
222+ const picker = new ModelSelectorComponent ( {
223+ models : {
224+ current : model ( 'Kimi K2' , [ 'thinking' ] , [ 'low' , 'high' , 'max' ] ) ,
225+ other : model ( 'Kimi K3' , [ 'thinking' ] , [ 'low' , 'high' , 'max' ] ) ,
226+ } ,
227+ currentValue : 'current' ,
228+ currentEffort : 'max' ,
229+ onSelect,
230+ onCancel : vi . fn ( ) ,
231+ } ) ;
232+
233+ picker . handleInput ( DOWN ) ;
234+ picker . handleInput ( '\r' ) ;
235+ expect ( onSelect ) . toHaveBeenLastCalledWith ( { alias : 'other' , effort : 'max' } ) ;
236+ } ) ;
237+
220238 it ( 'clamps the live effort when it is not in the current model’s set' , ( ) => {
221239 const onSelect = vi . fn ( ) ;
222240 const picker = new ModelSelectorComponent ( {
@@ -259,16 +277,16 @@ describe('ModelSelectorComponent', () => {
259277 onCancel : vi . fn ( ) ,
260278 } ) ;
261279
262- picker . handleInput ( DOWN ) ; // -> thinking model (defaults to first non- off level )
263- picker . handleInput ( RIGHT ) ; // low -> medium
280+ picker . handleInput ( DOWN ) ; // -> thinking model (keeps the live off state )
281+ picker . handleInput ( RIGHT ) ; // off -> low
264282 picker . handleInput ( UP ) ; // -> plain
265- picker . handleInput ( DOWN ) ; // -> thinking (the medium override persists)
283+ picker . handleInput ( DOWN ) ; // -> thinking (the low override persists)
266284 picker . handleInput ( '\r' ) ;
267285
268- expect ( onSelect ) . toHaveBeenCalledWith ( { alias : 'thinking' , effort : 'medium ' } ) ;
286+ expect ( onSelect ) . toHaveBeenCalledWith ( { alias : 'thinking' , effort : 'low ' } ) ;
269287 } ) ;
270288
271- it ( 'defaults a capable model to its first level but keeps the current model state ' , ( ) => {
289+ it ( 'keeps the live off state when moving to another capable model' , ( ) => {
272290 const onSelect = vi . fn ( ) ;
273291 const picker = new ModelSelectorComponent ( {
274292 models : {
@@ -284,10 +302,10 @@ describe('ModelSelectorComponent', () => {
284302 // The active model reflects its live (off) state.
285303 expect ( text ( picker ) ) . toContain ( '[ off ]' ) ;
286304 picker . handleInput ( DOWN ) ; // -> the other thinking-capable model
287- // A capable, non-active model defaults to its first non-off level .
288- expect ( text ( picker ) ) . toContain ( '[ med ]' ) ;
305+ // A capable, non-active model keeps the live effort instead of resetting .
306+ expect ( text ( picker ) ) . toContain ( '[ off ]' ) ;
289307 picker . handleInput ( '\r' ) ;
290- expect ( onSelect ) . toHaveBeenCalledWith ( { alias : 'other' , effort : 'medium ' } ) ;
308+ expect ( onSelect ) . toHaveBeenCalledWith ( { alias : 'other' , effort : 'off ' } ) ;
291309 } ) ;
292310
293311 it ( 'fuzzy-filters by typing and reports a match count' , ( ) => {
0 commit comments