Preserve plugin caches across display metadata refreshes (#46309)

## Why

Renewed image URLs and other display metadata changes unnecessarily invalidate loaded plugins and MCP and skill caches, even when installed plugin behavior is unchanged.

## What changed

- Compare installed plugin metadata by identity, version, enablement, policy, and availability before invalidating derived caches. Continue storing the full updated payload so display consumers receive fresh metadata.
- Preserve invalidation when behavioral metadata changes or reconciliation requires an effective plugin refresh.
- Export `remote_catalog_metadata_eq` to compare catalogs independently of display metadata and plugin display order, while retaining marketplace order significance.

## Testing

Add regression tests for display-only updates, behavioral changes, catalog ordering, and preservation of loaded skills and tool suggestions. Add an app-server integration test verifying that image URL renewals and badge updates preserve live MCP sessions and cached skill resources, while an authentication policy change invalidates resource caches.

GitOrigin-RevId: 22b9ba1234a9f850201c6890e03d1ef899a56c54
This commit is contained in:
vkg-oai authored and copyberry committed 2026-09-17 21:35:44 +00:00
1 parent fa8cf44985
commit 0c9be8a836
8 files changed
+697 -3

No files matched your search

+7 -1
View File
@@ -78,6 +78,9 @@ const MAX_CAPABILITY_SUMMARY_DESCRIPTION_LEN: usize = 1024;
#[path = "marketplace_policy/curated_loading_tests.rs"]
mod curated_marketplace_policy;
#[path = "remote_metadata_cache_tests.rs"]
mod remote_metadata_cache;
fn unrestricted_config_layer_stack() -> ConfigLayerStack {
ConfigLayerStack::default()
}
@@ -7270,7 +7273,10 @@ remote_plugin = true
/*on_effective_plugins_changed*/ None,
);
tokio::time::sleep(Duration::from_millis(400)).await;
let _guard = first_manager
.acquire_remote_installed_plugin_sync_guard()
.await
.expect("background bundle sync should finish");
server.verify().await;
}