forked from farhoodlabs/paperclip
fix(skills): handle prune type mismatch by using warnings for agent-attached skills
GitHub/sks_sh pruned skills don't have project/workspace context needed for the CompanySkillProjectScanConflict/Skipped types. Orphaned skills are silently deleted; skills still used by agents emit a warning instead of a conflict entry. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2044,16 +2044,11 @@ export function companySkillService(db: Db) {
|
||||
if (currentSlugs.has(skill.slug)) continue;
|
||||
const usedByAgents = await usage(companyId, skill.key);
|
||||
if (usedByAgents.length > 0) {
|
||||
conflicts.push({
|
||||
path: sourceLocator,
|
||||
existingSkillId: skill.id,
|
||||
existingSkillKey: skill.key,
|
||||
existingSourceLocator: sourceLocator,
|
||||
reason: `Skill "${skill.slug}" was removed from ${sourceLocator} but is still used by ${usedByAgents.map((a) => a.name).join(", ")}. Detach it from those agents first.`,
|
||||
});
|
||||
warnings.push(
|
||||
`Skill "${skill.slug}" was removed from ${sourceLocator} but is still used by ${usedByAgents.map((a) => a.name).join(", ")}. It will not be automatically removed.`,
|
||||
);
|
||||
} else {
|
||||
const deleted = await deleteSkill(companyId, skill.id);
|
||||
if (deleted) skipped.push(deleted);
|
||||
await deleteSkill(companyId, skill.id);
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user