mirror of
https://github.com/openai/codex.git
synced 2026-10-22 17:58:46 +00:00
## What changed - Apply `disabled_plugin_ids` to plugin skills, recommendations, hooks, and MCP servers without modifying shared plugin state. - Activate selection changes when the next task starts, keeping pending settings from changing the active runtime. - Hide app tools contributed only by disabled plugins from model tool catalogs and search. Preserve connectors shared with enabled plugins and existing direct Apps RPC behavior. - Include plugin identity in MCP approval keys and use that identity when persisting plugin tool approvals. ## Testing Add regression coverage for disabling and re-enabling plugin skills and tools, deferred activation of settings, shared connector ownership, selected plugin servers, executor hooks, and plugin-specific approval keys and persistence. GitOrigin-RevId: 1153ff6aa7ab6953d50e838da05203904ecd2956
33 lines
1.2 KiB
Rust
33 lines
1.2 KiB
Rust
//! Activates an admitted task's plugin selection without changing pending settings.
|
|
|
|
use std::sync::Arc;
|
|
|
|
use super::Session;
|
|
use super::turn_context::TurnContext;
|
|
|
|
impl Session {
|
|
pub(crate) async fn activate_plugin_selection(&self, turn_context: &TurnContext) {
|
|
let config = {
|
|
let mut state = self.state.lock().await;
|
|
if state.active_disabled_plugin_ids != turn_context.disabled_plugin_ids {
|
|
state.active_disabled_plugin_ids = turn_context.disabled_plugin_ids.clone();
|
|
self.mark_mcp_runtime_dirty();
|
|
}
|
|
Arc::clone(&state.session_configuration.original_config_do_not_use)
|
|
};
|
|
let plugin_outcome = self
|
|
.services
|
|
.plugins_manager
|
|
.plugins_for_config(&config.plugins_config_input())
|
|
.await
|
|
.without_plugins(&turn_context.disabled_plugin_ids);
|
|
// Cache changes from another process do not notify this session's hook runtime.
|
|
if !self.hooks().matches_plugin_hooks(
|
|
plugin_outcome.iter_effective_plugin_hook_sources(),
|
|
plugin_outcome.iter_effective_plugin_hook_warnings(),
|
|
) {
|
|
self.refresh_hooks(config).await;
|
|
}
|
|
}
|
|
}
|