File tree Expand file tree Collapse file tree
packages/provider-acp-registry/src/server Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -175,6 +175,37 @@ describe("acpRegistrySnapshotReadiness", () => {
175175 nativeSessions : { canList : true , canLoad : true , canResume : true } ,
176176 models : [ { slug : "live-model" , isDefault : true } ] ,
177177 } ) ;
178+
179+ expect (
180+ applyAcpRegistryLiveConfiguration (
181+ provider ,
182+ { models : [ ] , currentModelId : null , configOptions : [ ] } ,
183+ [ ] ,
184+ ) . models ,
185+ ) . toEqual ( provider . models ) ;
186+
187+ const liveOptions = [
188+ {
189+ id : "effort" ,
190+ label : "Effort" ,
191+ type : "select" as const ,
192+ options : [ { id : "high" , label : "High" } ] ,
193+ currentValue : "high" ,
194+ } ,
195+ ] ;
196+ expect (
197+ applyAcpRegistryLiveConfiguration (
198+ provider ,
199+ { models : [ ] , currentModelId : null , configOptions : liveOptions } ,
200+ [ ] ,
201+ ) . models ,
202+ ) . toMatchObject ( [
203+ {
204+ slug : "probe-model" ,
205+ isDefault : true ,
206+ capabilities : { optionDescriptors : [ { id : "effort" , currentValue : "high" } ] } ,
207+ } ,
208+ ] ) ;
178209 } ) ;
179210
180211 it ( "projects discovery without claiming authentication when no login methods are advertised" , ( ) => {
Original file line number Diff line number Diff line change @@ -258,10 +258,28 @@ export function applyAcpRegistryLiveConfiguration(
258258 customModels : ReadonlyArray < string > ,
259259) : ServerProvider {
260260 const { message : _staleProbeMessage , ...snapshot } = provider ;
261+ // session/load may omit models (Kimi returns `{}`); keep the probed list
262+ // and apply any live option descriptors to it.
263+ const probedModels = provider . models . filter ( ( model ) => ! model . isCustom ) ;
264+ const discovery =
265+ configuration . models . length > 0
266+ ? configuration
267+ : {
268+ ...configuration ,
269+ models : probedModels . map ( ( model ) => ( {
270+ id : model . slug ,
271+ name : model . name ,
272+ description : null ,
273+ } ) ) ,
274+ currentModelId : probedModels . find ( ( model ) => model . isDefault ) ?. slug ?? null ,
275+ } ;
261276 return {
262277 ...snapshot ,
263278 status : provider . enabled ? "ready" : provider . status ,
264- models : modelsFromDiscovery ( configuration , customModels ) ,
279+ models :
280+ configuration . models . length === 0 && configuration . configOptions . length === 0
281+ ? provider . models
282+ : modelsFromDiscovery ( discovery , customModels ) ,
265283 } ;
266284}
267285
You can’t perform that action at this time.
0 commit comments