Add plugin ID to skill analytics (#20923)

## Summary
- thread plugin skill roots through the skills loader with their plugin
ID
- store plugin ID on loaded skill metadata for plugin-provided skills
- include plugin ID on skill invocation analytics events

## Test plan
- cargo check -p codex-core-skills
- cargo check -p codex-core -p codex-core-plugins -p codex-analytics
- cargo check -p codex-tui
- cargo check -p codex-plugin -p codex-core -p codex-core-plugins -p
codex-analytics
- cargo check -p codex-app-server
- cargo test -p codex-analytics
- HOME=/private/tmp/codex-empty-home cargo test -p codex-core-skills
- just fix -p codex-core-skills
- just fix -p codex-analytics
- just fix -p codex-core-plugins
- just fix -p codex-core
- just fmt
- git diff --check
This commit is contained in:
alexsong-oai
2026-05-04 20:36:29 -07:00
committed by GitHub
parent 707e51bd8b
commit 3ad7cf0993
27 changed files with 228 additions and 20 deletions
+3
View File
@@ -569,6 +569,7 @@ async fn load_plugin(
loaded_plugin.skill_roots = plugin_skill_roots(&plugin_root, manifest_paths);
let resolved_skills = load_plugin_skills(
&plugin_root,
&loaded_plugin_id,
manifest_paths,
restriction_product,
skill_config_rules,
@@ -647,6 +648,7 @@ impl ResolvedPluginSkills {
pub async fn load_plugin_skills(
plugin_root: &AbsolutePathBuf,
plugin_id: &PluginId,
manifest_paths: &PluginManifestPaths,
restriction_product: Option<Product>,
skill_config_rules: &SkillConfigRules,
@@ -657,6 +659,7 @@ pub async fn load_plugin_skills(
path,
scope: SkillScope::User,
file_system: Arc::clone(&LOCAL_FS),
plugin_id: Some(plugin_id.as_key()),
})
.collect::<Vec<_>>();
let outcome = load_skills_from_roots(roots).await;