core-skills: separate selected and local skill root authority

This commit is contained in:
starr-openai
2026-05-29 15:50:31 -07:00
parent 033d1d0741
commit 83b7372e0f
7 changed files with 499 additions and 256 deletions
+7 -7
View File
@@ -19,7 +19,7 @@ use codex_core_skills::config_rules::resolve_disabled_skill_paths;
use codex_core_skills::config_rules::skill_config_rules_from_stack;
use codex_core_skills::loader::SkillRoot;
use codex_core_skills::loader::load_skills_from_roots;
use codex_exec_server::LOCAL_FS;
use codex_exec_server::EnvironmentPathRef;
use codex_plugin::AppConnectorId;
use codex_plugin::LoadedPlugin;
use codex_plugin::PluginCapabilitySummary;
@@ -40,7 +40,6 @@ use std::collections::HashSet;
use std::fs;
use std::path::Path;
use std::process::Command;
use std::sync::Arc;
use tempfile::TempDir;
use tracing::warn;
@@ -564,8 +563,10 @@ async fn load_plugin(
.or_else(|| Some(manifest.name.clone()));
loaded_plugin.manifest_description = manifest.description.clone();
loaded_plugin.skill_roots = plugin_skill_roots(&plugin_root, manifest_paths);
// TODO: Support multi-env plugin skill loading. Plugin discovery is local-only today, so bind
// plugin skill reads to the local environment instead of the selected turn environment.
let resolved_skills = load_plugin_skills(
&plugin_root,
EnvironmentPathRef::local(plugin_root.clone()),
&loaded_plugin_id,
manifest_paths,
restriction_product,
@@ -642,18 +643,17 @@ impl ResolvedPluginSkills {
}
pub async fn load_plugin_skills(
plugin_root: &AbsolutePathBuf,
plugin_root: EnvironmentPathRef,
plugin_id: &PluginId,
manifest_paths: &PluginManifestPaths,
restriction_product: Option<Product>,
skill_config_rules: &SkillConfigRules,
) -> ResolvedPluginSkills {
let roots = plugin_skill_roots(plugin_root, manifest_paths)
let roots = plugin_skill_roots(plugin_root.path(), manifest_paths)
.into_iter()
.map(|path| SkillRoot {
path,
path: plugin_root.with_path(path),
scope: SkillScope::User,
file_system: Arc::clone(&LOCAL_FS),
plugin_id: Some(plugin_id.as_key()),
plugin_root: Some(plugin_root.clone()),
})
+3 -1
View File
@@ -1419,8 +1419,10 @@ impl PluginsManager {
manifest.interface.clone(),
marketplace_category,
);
// TODO: Support multi-env plugin skill loading. Marketplace plugins are installed and
// scanned locally today, so bind plugin skill reads to the local environment.
let resolved_skills = load_plugin_skills(
&source_path,
codex_exec_server::EnvironmentPathRef::local(source_path.clone()),
&plugin_id,
&manifest.paths,
self.restriction_product,