Refresh hook runtimes after plugin changes (#38703)

## What changed

- Rebuild hook runtimes for loaded sessions when effective plugins change or a marketplace upgrade installs new plugin content.
- Refresh plugin-related caches and MCP runtimes alongside hooks after plugin mutations.
- Preserve each loaded session's current configuration while rebuilding its hooks.

## Testing

- Cover direct plugin upgrades, including subsequent turn and session-end hooks.
- Cover automatic marketplace upgrades for an already loaded session.

GitOrigin-RevId: fef64c68d652f300c7f3d88e81c5017459aa9a18
This commit is contained in:
Abhinav authored and copyberry committed 2026-08-15 05:28:53 +00:00
1 parent 53f3fa7496
commit e5470f1bce
7 files changed
+490 -6

No files matched your search

+4
View File
@@ -1733,6 +1733,10 @@ impl Session {
};
self.emit_config_changed_contributors(previous_config.as_ref(), new_config.as_ref());
self.schedule_mcp_prewarm();
self.refresh_hooks(config).await;
}
pub(crate) async fn refresh_hooks(&self, config: Arc<Config>) {
let environments = self.services.turn_environments.snapshot().await;
let hooks_config = build_hooks_config(
config.as_ref(),