mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Honor layered configuration when loading plugins (#40954)
## What changed - Resolve plugin activation, MCP server policy, and marketplace definitions from the effective configuration stack, including system settings and trusted project overrides. - Load plugin skills independently for each working directory passed to `skills/list`. - Exclude project configuration from catalog requests whose `cwds` are omitted or empty. - Cache up to eight loaded plugin configurations with least-recently-used eviction so requests for different working directories can reuse their results. ## Testing - Cover layered plugin and MCP policy across trusted and untrusted projects. - Cover per-directory skill and plugin catalog results, cache reuse and eviction, and system-defined marketplaces. GitOrigin-RevId: cb68b2b1bdab1da48e05ca7562bc05014431fc71
This commit is contained in:
1 parent
7276d67081
commit
6ac012a0d4
18 files changed
+490
-132
No files matched your search
@@ -723,7 +723,7 @@ fn is_full_git_sha(value: &str) -> bool {
|
||||
value.len() == 40 && value.chars().all(|ch| ch.is_ascii_hexdigit())
|
||||
}
|
||||
|
||||
fn configured_plugins_from_user_config_value(
|
||||
fn configured_plugins_from_config_value(
|
||||
user_config: &toml::Value,
|
||||
) -> HashMap<String, PluginConfig> {
|
||||
let Some(plugins_value) = user_config.get("plugins") else {
|
||||
@@ -769,7 +769,7 @@ fn configured_plugins_from_codex_home(
|
||||
}
|
||||
};
|
||||
|
||||
configured_plugins_from_user_config_value(&user_config)
|
||||
configured_plugins_from_config_value(&user_config)
|
||||
}
|
||||
|
||||
fn configured_plugin_ids(
|
||||
@@ -1391,7 +1391,7 @@ pub async fn load_plugin_mcp_servers(
|
||||
load_plugin_mcp_servers_with_policy(plugin_root, auth_mode, /*plugin_policy*/ None).await
|
||||
}
|
||||
|
||||
/// Loads plugin MCP servers with the effective user policy for an installed plugin.
|
||||
/// Loads plugin MCP servers with the effective configuration policy for an installed plugin.
|
||||
pub async fn load_configured_plugin_mcp_servers(
|
||||
plugin_root: &Path,
|
||||
auth_mode: Option<AuthMode>,
|
||||
@@ -1412,10 +1412,7 @@ pub async fn load_configured_plugin_mcp_servers(
|
||||
pub fn configured_plugin_mcp_server_policies(
|
||||
config_layer_stack: &ConfigLayerStack,
|
||||
) -> HashMap<String, HashMap<String, PluginMcpServerConfig>> {
|
||||
config_layer_stack
|
||||
.effective_user_config()
|
||||
.map(|config| configured_plugins_from_user_config_value(&config))
|
||||
.unwrap_or_default()
|
||||
configured_plugins_from_config_value(&config_layer_stack.effective_config())
|
||||
.into_iter()
|
||||
.map(|(plugin_id, plugin)| (plugin_id, plugin.mcp_servers))
|
||||
.collect()
|
||||
|
||||
Reference in new issue
Block a user