@@ -90,6 +90,35 @@ describe("Session config options", () => {
9090 ) ;
9191 } ) ;
9292
93+ it ( "shows the current uncataloged model as its own selectable option" , async ( ) => {
94+ const { fast, slow} = buildModels ( ) ;
95+ const { codexAcpAgent, response} = await createSession ( "custom-model[high]" , [ fast , slow ] ) ;
96+
97+ const ids = response . configOptions ?. map ( o => o . id ) ;
98+ expect ( ids ) . toEqual ( [ MODE_CONFIG_ID , MODEL_CONFIG_ID , "fast-mode" ] ) ;
99+
100+ const modelOption = response . configOptions ?. find ( o => o . id === MODEL_CONFIG_ID ) ;
101+ expect ( modelOption ) . toMatchObject ( {
102+ category : "model" ,
103+ currentValue : "custom-model" ,
104+ type : "select" ,
105+ options : [
106+ { value : "custom-model" , name : "custom-model" , description : null } ,
107+ { value : "fast-model" , name : "Fast model" , description : "Frontier" } ,
108+ { value : "slow-model" , name : "Slow model" , description : "Strong" } ,
109+ ] ,
110+ } ) ;
111+ expect ( response . configOptions ?. some ( o => o . id === REASONING_EFFORT_CONFIG_ID ) ) . toBe ( false ) ;
112+
113+ await codexAcpAgent . setSessionConfigOption ( {
114+ sessionId : "session-id" ,
115+ configId : MODEL_CONFIG_ID ,
116+ value : "custom-model" ,
117+ } ) ;
118+
119+ expect ( codexAcpAgent . getSessionState ( "session-id" ) . currentModelId ) . toBe ( "custom-model[high]" ) ;
120+ } ) ;
121+
93122 it ( "keeps the legacy models list as combined model/effort entries" , async ( ) => {
94123 const { fast, slow} = buildModels ( ) ;
95124 const { response} = await createSession ( "fast-model[medium]" , [ fast , slow ] ) ;
0 commit comments