connectors: announce global-server and reinstall refreshes on the bus
Nightly Build / build (push) Successful in 6m56s

Five call-sites reached into the live-runtime refresh helpers from HTTP
handlers, the same shape as the container remounts. Only three of them
belonged on the bus, and finding out which was the point.

global_enable and global_delete now emit McpGlobalServersChanged, and the
marketplace reinstall emits ConnectorReinstalled. All three are pure
reconciliation: the first only makes a connector appear; the second is
already enforced by stop_server, with the snapshot refresh just tidying
each user's filter; the third pushes metadata and code into what is
already running. The reinstall gains something from being off the
response path, since it re-copies files and restarts servers inside every
live user's container.

global_set_access and user_connectors_set keep calling
refresh_global_mcp_access directly. Their writes *replace* a grant set, so
anyone dropped from the list is being revoked and that refresh is what
enforces it — on a best-effort broadcast a revoked user would keep the
connector until their next login. Both carry a DELIBERATELY SYNCHRONOUS
comment, since they are otherwise indistinguishable from the announced
call-sites and are exactly what a later cleanup would sweep up.

No behaviour change for the two synchronous paths; the three announced
ones now return without waiting for the refresh.
This commit is contained in:
2026-07-26 22:22:29 +01:00
parent 0ba140186f
commit 305bdbdd2b
5 changed files with 59 additions and 18 deletions
+9
View File
@@ -154,6 +154,15 @@ pub(super) fn spawn_user_lifecycle(skald: &Arc<super::Skald>) {
"user-lifecycle: remount failed (settles at next login/boot)");
}
}
// Both are pure appearance/metadata refreshes across live users —
// they widen or re-sync what is visible, never narrow it, which is
// what makes them safe to hand to a best-effort bus.
SystemEvent::McpGlobalServersChanged => {
skald.refresh_global_mcp_access().await;
}
SystemEvent::ConnectorReinstalled { catalog_name } => {
skald.refresh_connector_after_reinstall(&catalog_name).await;
}
_ => {}
}
}