@@ -140,7 +140,7 @@ test('CLI model editor keeps machine account and personal API Key catalogs indep
140140 app . router . post ( '/api/runners/runner-cb/models/probe' , {
141141 source :'runner' , models :[ { id :'codex/account-model' , name :'Account model' } ] ,
142142 } ) ;
143- app . router . post ( '/api/users/1/cli-models/probe' , {
143+ app . router . post ( '/api/users/1/cli-models/probe' , ( { body } ) => body . connectOnly ? { source : 'official' , connected : true } : {
144144 source :'official' , models :[ model , { id :'another-model' , name :'Another model' } ] ,
145145 } ) ;
146146 app . router . put ( '/api/runners/runner-cb/models' , ( { body} ) => {
@@ -181,8 +181,14 @@ test('CLI model editor keeps machine account and personal API Key catalogs indep
181181 assert . deepEqual ( modelIDs ( ) , [ model . id ] ) ;
182182 picker ( 'probe' ) . click ( ) ;
183183 await settle ( ) ;
184- assert . match ( app . document . querySelector ( '.runner-model-editor' ) . textContent , / 来 自 官 方 服 务 / ) ;
184+ assert . match ( app . document . querySelector ( '.runner-model-editor' ) . textContent , / 来 自 C o d e B u d d y C L I / ) ;
185185 assert . deepEqual ( app . router . calls . find ( c => c . path . endsWith ( '/cli-models/probe' ) ) . body , { engine :'codebuddy' , apiKey :'' } ) ;
186+ picker ( 'connection' ) . click ( ) ;
187+ await settle ( ) ;
188+ assert . match ( app . document . querySelector ( '.runner-model-editor [data-catalog-probe]' ) . textContent , / 连 接 成 功 / ) ;
189+ assert . deepEqual ( app . router . calls . filter ( c => c . path . endsWith ( '/cli-models/probe' ) ) . at ( - 1 ) . body , {
190+ engine :'codebuddy' , apiKey :'' , connectOnly :true , model :model . id ,
191+ } ) ;
186192 app . document . querySelector ( '#confirmCancelBtn' ) . click ( ) ;
187193} ) ;
188194
0 commit comments