mirror of
https://github.com/openai/codex.git
synced 2026-11-16 22:00:36 +00:00
Honor managed plugin disablement for executor capabilities (#40640)
## Why Selected executor plugin roots could still expose capabilities when managed requirements disabled the `plugins` feature. ## What changed - Suppress MCP servers, skills, apps, and connectors from selected executor plugins when `plugins` is disabled, while preserving the selected-root identity used to filter those capabilities. - Apply the policy consistently to direct selected-root discovery and batched executor capability discovery. ## Testing - Add contributor-level and app-server coverage that verifies disabled plugin capabilities are absent and their MCP servers never start. GitOrigin-RevId: e30bd8a936c4b0e083908b89a65f4d02e01747de
This commit is contained in:
@@ -9,6 +9,7 @@ use codex_extension_api::ExtensionFuture;
|
||||
use codex_extension_api::McpServerContribution;
|
||||
use codex_extension_api::McpServerContributionContext;
|
||||
use codex_extension_api::McpServerContributor;
|
||||
use codex_features::Feature;
|
||||
use codex_protocol::capabilities::SelectedCapabilityRoot;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
@@ -215,7 +216,11 @@ fn project_metadata(
|
||||
selected_root_id: &str,
|
||||
plugin: SelectedPluginMetadata,
|
||||
) -> Vec<McpServerContribution> {
|
||||
let mut servers = plugin.servers.iter().cloned().collect::<HashMap<_, _>>();
|
||||
let mut servers = if config.features.enabled(Feature::Plugins) {
|
||||
plugin.servers.iter().cloned().collect::<HashMap<_, _>>()
|
||||
} else {
|
||||
HashMap::new()
|
||||
};
|
||||
if let Some(plugin_policy) = plugin_policy {
|
||||
apply_configured_plugin_mcp_server_policies(plugin_policy, &mut servers);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user