fix(skills): recognize symlinked provider skill roots (#22606)

This commit is contained in:
Aaryan Porwal
2026-09-24 16:00:43 -07:00
committed by GitHub
parent 6ae6ed08bb
commit 29480cd8cd
2 changed files with 27 additions and 3 deletions
@@ -252,6 +252,32 @@ describe('read-only skill freshness inventory', () => {
expect(getSkillFreshnessDisplayStatus(inventory, 'orca-cli')).toBe('up-to-date')
})
it.runIf(process.platform !== 'win32')(
'deduplicates a symlinked provider skills root',
async () => {
const test = await fixture()
const canonicalRoot = join(test.homeDir, '.agents', 'skills')
await test.writeSkill(canonicalRoot, test.currentMarkdown)
await mkdir(join(test.homeDir, '.claude'), { recursive: true })
await symlink(canonicalRoot, join(test.homeDir, '.claude', 'skills'))
const inventory = await inventorySkillFreshness({
currentAppVersion: '2.0.0',
homeDir: test.homeDir,
repos: [],
resourceRoot: test.resourceRoot
})
expect(inventory.installations).toHaveLength(1)
expect(inventory.installations[0]).toMatchObject({
topology: 'canonical-copy',
status: 'current',
providers: ['agent-skills', 'claude']
})
expect(getSkillFreshnessDisplayStatus(inventory, 'orca-cli')).toBe('up-to-date')
}
)
it('reads up to date after the OS drops a sidecar into an untouched install', async () => {
const test = await fixture()
const directory = await test.writeSkill(
@@ -129,10 +129,8 @@ export async function classifyHomeSkillTopology(
normalizedSkillIdentityPath(dirname(resolvedPath)) ===
normalizedSkillIdentityPath(canonicalRoot)
let topology: SkillInstallationTopology
if (linked) {
if (linked || rootOrProviderParentLinked) {
topology = isCanonicalTarget ? 'provider-alias' : 'external-link'
} else if (rootOrProviderParentLinked) {
topology = 'external-link'
} else {
topology = root.id === 'home-agents' ? 'canonical-copy' : 'independent-copy'
}