mirror of
https://github.com/stablyai/orca.git
synced 2026-10-23 16:03:49 +00:00
test(skills): pin that a later granting source still grants visibility
find() let the first source at a path decide; the ordering is only observable when two roots resolve to one path with different owners.
This commit is contained in:
@@ -123,6 +123,35 @@ describe('isNativeChatSkillForAgent', () => {
|
||||
})
|
||||
expect(isNativeChatSkillForAgent('claude', codexOnly, result)).toBe(false)
|
||||
})
|
||||
|
||||
it('does not let a non-granting source at a path hide a granting one behind it', () => {
|
||||
// Two roots can resolve to one path (see `rootScanKey` in main/skills/discovery.ts),
|
||||
// and a provider root override can put an unowned root ahead of the agent's own.
|
||||
const result = {
|
||||
sources: [
|
||||
{
|
||||
id: 'shared-home',
|
||||
label: 'Agent skills home',
|
||||
path: '/Users/test/.claude/skills',
|
||||
sourceKind: 'home' as const,
|
||||
providers: ['agent-skills' as const],
|
||||
owner: null,
|
||||
exists: true
|
||||
},
|
||||
{
|
||||
id: 'home-claude',
|
||||
label: 'Claude home',
|
||||
path: '/Users/test/.claude/skills',
|
||||
sourceKind: 'home' as const,
|
||||
providers: ['claude' as const],
|
||||
owner: 'claude' as const,
|
||||
exists: true
|
||||
}
|
||||
]
|
||||
} satisfies Pick<SkillDiscoveryResult, 'sources'>
|
||||
const shared = skill({ rootPath: '/Users/test/.claude/skills' })
|
||||
expect(isNativeChatSkillForAgent('claude', shared, result)).toBe(true)
|
||||
})
|
||||
})
|
||||
|
||||
describe('resolveNativeChatSkillDiscoveryCwd', () => {
|
||||
|
||||
Reference in New Issue
Block a user