fix(cli): use additive merge in profile install/update to preserve local skills#25150
Open
zccyman wants to merge 1 commit into
Open
fix(cli): use additive merge in profile install/update to preserve local skills#25150zccyman wants to merge 1 commit into
zccyman wants to merge 1 commit into
Conversation
…cal skills _copy_dist_payload previously used shutil.rmtree + copytree for directories, destroying all locally-installed skills on every profile install or update. The distribution_owned manifest field existed but was never enforced during the copy phase. New _additive_copytree helper walks the source tree and overwrites only files present in the distribution, leaving local-only files intact. This prevents data loss while still correctly updating distribution shipped content. Closes NousResearch#25120
342c2ff to
e220f85
Compare
19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_copy_dist_payloadusedshutil.rmtree+copytreefor all directories, destroying locally-installed skills on everyhermes profile installorhermes profile update. Thedistribution_ownedmanifest field was parsed but never enforced during the copy phase.Before
Walking a profile with
skills/devops/my-custom-skill/→ gone after update.After
New
_additive_copytreehelper walks the source tree and copies/overwrites only files present in the distribution, preserving everything else:Behavior
Testing
_additive_copytree(new files, preserve local, overwrite dist, nested merge, ignore)_copy_dist_payload(install preserves locals, update overwrites dist only, fresh install)Files changed
hermes_cli/profile_distribution.py_additive_copytreehelper; replacermtree+copytreewith additive mergetests/hermes_cli/test_profile_distribution_additive.pyCloses #25120