fix(uninstall): preserve unmanaged skills with an empty inventory - #2947
Open
Marco Frömbgen (mfroembgen) wants to merge 2 commits into
Open
fix(uninstall): preserve unmanaged skills with an empty inventory#2947Marco Frömbgen (mfroembgen) wants to merge 2 commits into
Marco Frömbgen (mfroembgen) wants to merge 2 commits into
Conversation
Marco Frömbgen (mfroembgen)
requested review from
Daniel Meppiel (danielmeppiel) and
Sergio Sisternes (sergio-sisternes-epam)
as code owners
September 11, 2026 13:35
Copilot started reviewing on behalf of
Marco Frömbgen (mfroembgen)
September 11, 2026 13:36
View session
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved review issues remain, and all approval-readiness assessments indicate approval.
Pull request overview
Fixes uninstall cleanup so MCP-only packages preserve unmanaged skills when the lockfile has an empty deployment inventory.
Changes:
- Preserve empty lockfile-managed inventories.
- Add lifecycle regression coverage.
- Document the fix.
File summaries
| File | Description |
|---|---|
tests/integration/test_mcp_only_lockfile_lifecycle.py |
Verifies unmanaged skills survive and managed skills are removed. |
src/apm_cli/commands/uninstall/engine.py |
Preserves lockfile-scoped cleanup behavior. |
CHANGELOG.md |
Documents the bug fix. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Author
|
@microsoft-github-policy-service agree |
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.
Description
Uninstalling an MCP-only package could delete personal Claude and Kiro skills because an empty
deployed_filesinventory was converted toNone, enabling legacy orphan cleanup. Preserve the empty inventory when a lockfile exists so cleanup only removes recorded resources. The existing fallback for installations without a lockfile remains unchanged.Fixes #2946.
The lifecycle regression installs and uninstalls a local package with isolated agent settings. It verifies byte-for-byte preservation of personal
.claude,.kiro, and.agentsskills, removal of the package and its native MCP configuration, and normal managed-skill removal in a second case. The MCP-only case reproduced the deletion on upstreame38261c5before the fix.Type of change
Testing
Validation on macOS with Python 3.12:
uv run --no-sync pytest tests/unit tests/test_console.py -x -q): 22,299 passed, 42 skipped, 21 expected failures, and 99 subtests passed. The initial parallel run hit a temporary-directory assertion intest_detect_cleans_temp_dir_on_malicious_archive; the complete serial run passed.To run the lifecycle coverage:
Spec conformance (OpenAPM v0.1)
This restores the existing documented uninstall ownership contract; it introduces no new requirement or schema.
apm-spec-waiver: Restore documented lockfile-scoped uninstall cleanup for an empty deployment inventory; no new OpenAPM contract or schema.