mirror of
https://github.com/openai/codex.git
synced 2026-11-26 23:40:43 +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:
committed by
copyberry
parent
7276d67081
commit
6ac012a0d4
@@ -335,10 +335,8 @@ fn configured_marketplace_sources_by_root(
|
||||
plugins_input: &PluginsConfigInput,
|
||||
) -> HashMap<PathBuf, JsonMarketplaceSource> {
|
||||
let marketplace_sources = configured_marketplace_sources(plugins_input, codex_home);
|
||||
let Some(user_config) = plugins_input.config_layer_stack.effective_user_config() else {
|
||||
return HashMap::new();
|
||||
};
|
||||
let Some(marketplaces) = user_config
|
||||
let effective_config = plugins_input.config_layer_stack.effective_config();
|
||||
let Some(marketplaces) = effective_config
|
||||
.get("marketplaces")
|
||||
.and_then(toml::Value::as_table)
|
||||
else {
|
||||
|
||||
@@ -483,10 +483,8 @@ pub(crate) fn configured_marketplace_sources(
|
||||
plugins_input: &PluginsConfigInput,
|
||||
codex_home: &Path,
|
||||
) -> HashMap<String, JsonMarketplaceSource> {
|
||||
let Some(user_config) = plugins_input.config_layer_stack.effective_user_config() else {
|
||||
return HashMap::new();
|
||||
};
|
||||
let Some(marketplaces) = user_config
|
||||
let effective_config = plugins_input.config_layer_stack.effective_config();
|
||||
let Some(marketplaces) = effective_config
|
||||
.get("marketplaces")
|
||||
.and_then(toml::Value::as_table)
|
||||
else {
|
||||
@@ -726,10 +724,8 @@ pub(crate) fn configured_marketplace_snapshot_issues(
|
||||
load_errors: &[MarketplaceListError],
|
||||
marketplace_name: Option<&str>,
|
||||
) -> Vec<ConfiguredMarketplaceSnapshotIssue> {
|
||||
let Some(user_config) = plugins_input.config_layer_stack.effective_user_config() else {
|
||||
return Vec::new();
|
||||
};
|
||||
let Some(configured_marketplaces) = user_config
|
||||
let effective_config = plugins_input.config_layer_stack.effective_config();
|
||||
let Some(configured_marketplaces) = effective_config
|
||||
.get("marketplaces")
|
||||
.and_then(toml::Value::as_table)
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user