@@ -849,6 +849,7 @@ it.layer(
849849 } ,
850850 { slug : "default" , name : "Default" , isCustom : false , capabilities : null } ,
851851 ] ,
852+ nativeSessions : { canList : false , canLoad : false , canResume : false } ,
852853 slashCommands : [ ] ,
853854 skills : [ ] ,
854855 } as const satisfies ServerProvider ;
@@ -864,6 +865,37 @@ it.layer(
864865 ) ;
865866 } ) ;
866867
868+ it ( "drops stale ACP Registry models when an agent without sign-in completes discovery" , ( ) => {
869+ const previousProvider = {
870+ instanceId : ProviderInstanceId . make ( "acpRegistry_kimi" ) ,
871+ driver : ProviderDriverKind . make ( "acpRegistry" ) ,
872+ status : "ready" ,
873+ enabled : true ,
874+ installed : true ,
875+ auth : { status : "unknown" , canLogout : false } ,
876+ checkedAt : "2026-08-13T00:00:00.000Z" ,
877+ version : "1.2.0" ,
878+ models : [
879+ { slug : "kimi-old" , name : "Kimi Old" , isCustom : false , capabilities : null } ,
880+ { slug : "default" , name : "Default" , isCustom : false , capabilities : null } ,
881+ ] ,
882+ nativeSessions : { canList : true , canLoad : true , canResume : false } ,
883+ slashCommands : [ ] ,
884+ skills : [ ] ,
885+ } as const satisfies ServerProvider ;
886+ // Agents that advertise no auth methods stay "unknown" after every probe.
887+ const probedProvider = {
888+ ...previousProvider ,
889+ checkedAt : "2026-08-13T00:01:00.000Z" ,
890+ models : [ { slug : "kimi-new" , name : "Kimi New" , isCustom : false , capabilities : null } ] ,
891+ } satisfies ServerProvider ;
892+
893+ assert . deepStrictEqual (
894+ ProviderRegistry . mergeProviderSnapshot ( previousProvider , probedProvider ) . models ,
895+ [ ...probedProvider . models ] ,
896+ ) ;
897+ } ) ;
898+
867899 it ( "retains ACP Registry models while discovery has not completed" , ( ) => {
868900 const previousProvider = {
869901 instanceId : ProviderInstanceId . make ( "acpRegistry_codex" ) ,
@@ -882,11 +914,19 @@ it.layer(
882914 ...previousProvider ,
883915 checkedAt : "2026-08-13T00:01:00.000Z" ,
884916 auth : { status : "unknown" } ,
917+ message : "Checking ACP authentication, models, and commands in the background..." ,
885918 models : [ { slug : "default" , name : "Default" , isCustom : false , capabilities : null } ] ,
886919 } satisfies ServerProvider ;
920+ // A saved sign-in confirmation marks the readiness snapshot authenticated
921+ // before discovery has run.
922+ const confirmedCheckingProvider = {
923+ ...checkingProvider ,
924+ auth : { status : "authenticated" } ,
925+ } satisfies ServerProvider ;
887926 const failedProbeProvider = {
888927 ...checkingProvider ,
889928 status : "warning" ,
929+ message : "ACP discovery failed." ,
890930 } satisfies ServerProvider ;
891931
892932 assert . deepStrictEqual (
@@ -896,6 +936,13 @@ it.layer(
896936 { slug : "gpt-5.6-sol" , name : "GPT-5.6-Sol" , isCustom : false , capabilities : null } ,
897937 ] ,
898938 ) ;
939+ assert . deepStrictEqual (
940+ ProviderRegistry . mergeProviderSnapshot ( previousProvider , confirmedCheckingProvider ) . models ,
941+ [
942+ { slug : "default" , name : "Default" , isCustom : false , capabilities : null } ,
943+ { slug : "gpt-5.6-sol" , name : "GPT-5.6-Sol" , isCustom : false , capabilities : null } ,
944+ ] ,
945+ ) ;
899946 assert . deepStrictEqual (
900947 ProviderRegistry . mergeProviderSnapshot ( previousProvider , failedProbeProvider ) . models ,
901948 [
0 commit comments