mirror of
https://github.com/openai/codex.git
synced 2026-10-21 17:48:44 +00:00
Refresh session hooks after external plugin updates (#42990)
## Why Plugin updates made by another process do not notify a loaded session's hook runtime, leaving it with stale hooks. ## What changed Compare the current plugin hook sources and load warnings with those retained by the hook runtime during turn construction. Refresh hooks when either differs so existing sessions pick up external plugin updates. ## Testing Add an app-server regression test that updates the shared plugin store without notifying the server and verifies that successive turns in the same thread run the installed hooks across an upgrade and a rollback. GitOrigin-RevId: d3a2653ac4c069d9d8a02f30e21e4506d76a091c
This commit is contained in:
@@ -169,19 +169,27 @@ impl<M: Clone> PluginLoadOutcome<M> {
|
||||
}
|
||||
|
||||
pub fn effective_plugin_hook_sources(&self) -> Vec<PluginHookSource> {
|
||||
self.iter_effective_plugin_hook_sources().cloned().collect()
|
||||
}
|
||||
|
||||
pub fn iter_effective_plugin_hook_sources(&self) -> impl Iterator<Item = &PluginHookSource> {
|
||||
self.plugins
|
||||
.iter()
|
||||
.filter(|plugin| plugin.is_active())
|
||||
.flat_map(|plugin| plugin.hook_sources.iter().cloned())
|
||||
.collect()
|
||||
.flat_map(|plugin| plugin.hook_sources.iter())
|
||||
}
|
||||
|
||||
pub fn effective_plugin_hook_warnings(&self) -> Vec<String> {
|
||||
self.iter_effective_plugin_hook_warnings()
|
||||
.cloned()
|
||||
.collect()
|
||||
}
|
||||
|
||||
pub fn iter_effective_plugin_hook_warnings(&self) -> impl Iterator<Item = &String> {
|
||||
self.plugins
|
||||
.iter()
|
||||
.filter(|plugin| plugin.is_active())
|
||||
.flat_map(|plugin| plugin.hook_load_warnings.iter().cloned())
|
||||
.collect()
|
||||
.flat_map(|plugin| plugin.hook_load_warnings.iter())
|
||||
}
|
||||
|
||||
pub fn capability_summaries(&self) -> &[PluginCapabilitySummary] {
|
||||
|
||||
Reference in New Issue
Block a user