@@ -1203,23 +1203,29 @@ it.effect("on-demand clients get provider config without workspace snapshots", (
12031203 refreshed . providers . map ( ( entry ) => [ entry . workspaceSnapshots , entry . slashCommands ] ) ,
12041204 [ [ [ snapshotFor ( "/b" , "2026-10-25T00:00:00.000Z" ) ] , [ ] ] ] ,
12051205 ) ;
1206- // A failed scan still gives a client without the machine catalog its commands.
1207- yield * server . write ( 0 , {
1208- _tag : "Request" ,
1209- id : RpcMessage . RequestId ( "refresh-failed-scan" ) ,
1210- tag : WS_METHODS . serverRefreshProviders ,
1211- payload : {
1212- instanceId,
1213- cwd : "/c" ,
1214- workspaceSnapshotsOnDemand : true ,
1215- providerCatalogsOnDemand : true ,
1216- } ,
1217- headers : Headers . empty ,
1206+ const refreshCatalogOnDemand = Effect . fn ( function * ( id : string ) {
1207+ yield * server . write ( 0 , {
1208+ _tag : "Request" ,
1209+ id : RpcMessage . RequestId ( id ) ,
1210+ tag : WS_METHODS . serverRefreshProviders ,
1211+ payload : {
1212+ instanceId,
1213+ cwd : "/c" ,
1214+ workspaceSnapshotsOnDemand : true ,
1215+ providerCatalogsOnDemand : true ,
1216+ } ,
1217+ headers : Headers . empty ,
1218+ } ) ;
1219+ const response = ( yield * Queue . take ( responses ) ) as {
1220+ readonly providers : ReadonlyArray < ServerProvider > ;
1221+ } ;
1222+ return response . providers [ 0 ] ?. workspaceSnapshots ;
12181223 } ) ;
1219- const fallback = ( yield * Queue . take ( responses ) ) as {
1220- readonly providers : ReadonlyArray < ServerProvider > ;
1221- } ;
1222- assert . deepEqual ( fallback . providers [ 0 ] ?. workspaceSnapshots , [
1224+ // A provider that cannot scan already sent its machine catalog, so nothing stays pending.
1225+ assert . deepEqual ( yield * refreshCatalogOnDemand ( "refresh-no-scan" ) , [ ] ) ;
1226+ // A failed scan still gives a client without the machine catalog its commands.
1227+ scansCwd = true ;
1228+ assert . deepEqual ( yield * refreshCatalogOnDemand ( "refresh-failed-scan" ) , [
12231229 {
12241230 cwd : "/c" ,
12251231 checkedAt : provider . checkedAt ,
0 commit comments