Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

[codex] Emit implicit skill usage for support reads (#29731)

alexsong-oaif959e7fc9832
diff --git a/codex-rs/core-skills/src/service.rs b/codex-rs/core-skills/src/service.rs
index 1c956d79b9..b4e0d7396c 100644
--- a/codex-rs/core-skills/src/service.rs
+++ b/codex-rs/core-skills/src/service.rs
@@ -327,8 +327,16 @@ fn finalize_skill_outcome(
disabled_paths: HashSet<AbsolutePathBuf>,
) -> SkillLoadOutcome {
outcome.disabled_paths = disabled_paths;
- let (by_scripts_dir, by_doc_path) =
- build_implicit_skill_path_indexes(outcome.allowed_skills_for_implicit_invocation());
+ // Usage-event detection should see any enabled skill file/script read, even when the
+ // skill is not model-routable through implicit invocation.
+ let (by_scripts_dir, by_doc_path) = build_implicit_skill_path_indexes(
+ outcome
+ .skills
+ .iter()
+ .filter(|skill| outcome.is_skill_enabled(skill))
+ .cloned()
+ .collect(),
+ );
outcome.implicit_skills_by_scripts_dir = Arc::new(by_scripts_dir);
outcome.implicit_skills_by_doc_path = Arc::new(by_doc_path);
outcome