Preserve discovery paths for symlinked skills (#37144)

## Why

Symlinked skills have a canonical `SKILL.md` path that can differ from the path
under the configured skill root. A catalog entry that advertises the discovery
path must still select the canonical skill.

## What changed

- Track each loaded skill's discovery path alongside its canonical identity.
- Render discovery paths in the skill catalog and accept either form for
  structured selections and linked skill mentions.
- Preserve enabled-state checks, deduplication, and product filtering when
  resolving discovery paths.

## Testing

Added loader, catalog, mention-resolution, and end-to-end turn coverage for
skills discovered through directory symlinks.

GitOrigin-RevId: bae539b766cc3782c7c121a4276c337699cbb509
This commit is contained in:
xl-openai
2026-08-05 19:51:51 +00:00
committed by copyberry
parent fa5d5ae047
commit 72d937ed4d
11 changed files with 392 additions and 49 deletions
+4 -12
View File
@@ -691,12 +691,8 @@ async fn required_mcp_servers_for_input(
};
let skills_snapshot = turn_context.skills_snapshot();
let skills_outcome = skills_snapshot.outcome();
let mentioned_skills = collect_explicit_skill_mentions(
user_input,
&skills_outcome.skills,
&skills_outcome.disabled_paths,
&connector_slug_counts,
);
let mentioned_skills =
collect_explicit_skill_mentions(user_input, skills_outcome, &connector_slug_counts);
for skill in mentioned_skills {
if let Some(dependencies) = skill.dependencies {
required_servers.extend(
@@ -771,12 +767,8 @@ async fn build_skills_and_plugins(
.await?;
let skill_name_counts_lower =
build_skill_name_counts(&skills_outcome.skills, &skills_outcome.disabled_paths).1;
let mentioned_skills = collect_explicit_skill_mentions(
user_input,
&skills_outcome.skills,
&skills_outcome.disabled_paths,
&connector_slug_counts,
);
let mentioned_skills =
collect_explicit_skill_mentions(user_input, skills_outcome, &connector_slug_counts);
maybe_prompt_and_install_mcp_dependencies(
sess,
turn_context,