Describe the bug
Updating an existing Skill draft with a reduced resource-file set updates the version storage descriptor but does not delete the omitted files from the configured AI storage provider. The omitted files become unreferenced storage objects and cannot be cleaned by later draft or Skill deletion.
Expected behavior
A Skill draft update is a full-content replacement. After the update succeeds, files that were referenced by the previous storage descriptor but are absent from the new Skill content should be deleted through the provider persisted for that version.
Actually behavior
SkillOperationServiceImpl.updateDraft calls writeSkillToStorage for the new content and replaces the version storage descriptor with the returned file list. writeSkillToStorage only saves files present in the request. It does not compare the old and new file lists or delete removed files.
The removed files disappear from Skill query/download results because the new descriptor no longer references them, but their backing storage entries remain. Later deletion reads only the new descriptor, so those entries remain orphaned.
How to Reproduce
- Create a Skill draft containing
SKILL.md and multiple resource files.
- Update the same draft while omitting one or more existing resource files.
- Query or download the draft and confirm that the omitted files are no longer returned.
- Inspect the configured AI storage provider and observe that the omitted file entries still exist.
- Delete the draft or Skill and observe that the orphaned entries are not cleaned because they are absent from the current storage descriptor.
Desktop (please complete the following information):
- OS: All
- Version: current
develop
- Module:
ai
- SDK: original
Additional context
The fix should preserve the version's persisted storage provider, compare the previous and replacement descriptors, and delete only the removed file keys. The Skill specification should also clarify that draft overwrite/update replaces the complete package content and removes omitted resource files from storage.
Describe the bug
Updating an existing Skill draft with a reduced resource-file set updates the version storage descriptor but does not delete the omitted files from the configured AI storage provider. The omitted files become unreferenced storage objects and cannot be cleaned by later draft or Skill deletion.
Expected behavior
A Skill draft update is a full-content replacement. After the update succeeds, files that were referenced by the previous storage descriptor but are absent from the new Skill content should be deleted through the provider persisted for that version.
Actually behavior
SkillOperationServiceImpl.updateDraftcallswriteSkillToStoragefor the new content and replaces the version storage descriptor with the returned file list.writeSkillToStorageonly saves files present in the request. It does not compare the old and new file lists or delete removed files.The removed files disappear from Skill query/download results because the new descriptor no longer references them, but their backing storage entries remain. Later deletion reads only the new descriptor, so those entries remain orphaned.
How to Reproduce
SKILL.mdand multiple resource files.Desktop (please complete the following information):
developaiAdditional context
The fix should preserve the version's persisted storage provider, compare the previous and replacement descriptors, and delete only the removed file keys. The Skill specification should also clarify that draft overwrite/update replaces the complete package content and removes omitted resource files from storage.