Repository navigation
[BUG] stale-file cleanup reports dependency key as deletion location #3026
Description
Describe the bug
The stale-file cleanup diagnostic presents a dependency key as though it were the filesystem location from which files were deleted:
f"Cleaned {count} stale {noun} from {dep_key}"For an absolute local-path dependency, the displayed path identifies the source package even though cleanup occurs under the deployment root. A before/after inventory confirms that the source remains unchanged.
To Reproduce
- Create a local-path package containing a skill and an ignored generated file.
- Install it globally with
--target agent-skills. - Uninstall it by its
_local/<name>key. - Observe output such as:
Cleaned 6 stale files from /absolute/path/to/source
The source tree remains unchanged; /absolute/path/to/source is the dependency identifier passed as dep_key, not the deletion location.
Expected behavior
The diagnostic should not describe a dependency identifier as a deletion location. It can report the package relationship directly:
Cleaned 6 stale deployed files for _local/source
If a location is reported, it should be derived from the actual deleted targets rather than dep_key.
Environment (please complete the following information):
- OS: macOS
- Python Version: 3.14.7
- APM Version: 0.31.0 installed with Homebrew
- VSCode Version (if relevant): Not applicable
Logs
The relevant output is included in the reproduction above.
Additional context
Both CommandLogger.stale_cleanup implementations format dep_key after from, and generic install-cleanup and manifest-reconciliation paths call those methods.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
[-][BUG] uninstall cleans files inside a local dependency source checkout[/-][+][BUG] uninstall reports local dependency source as stale-file cleanup location[/+][-][BUG] uninstall reports local dependency source as stale-file cleanup location[/-][+][BUG] stale-file cleanup reports dependency key as deletion location[/+]sergio-sisternes-epam commentedon Sep 20, 2026
Thanks for the reproduction. Both
CommandLogger.stale_cleanupimplementations formatdep_keyafterfrominsrc/apm_cli/core/command_logger.py. For an absolute local-path dependency that key is the source package path, so uninstall can printCleaned N stale files from /absolute/path/to/sourceeven though cleanup runs under the deployment root and the source tree is unchanged.This is an advisory recommendation only. It is not scope approval, assignment, or a release target. Please wait for a responsible maintainer to record bounded scope and a review contact on this issue before any implementation.
Suggested direction if a maintainer accepts:
dep_keyas a package relationship, for exampleCleaned 6 stale deployed files for _local/<name>.dep_key.Proposed classification:
type/bug,area/cli.Next step for maintainers: review the reproduction and, if the project can support the fix, post the human scope record from CONTRIBUTING.md.
Generated by autopilot-issue-triage-worker. This comment is AI-generated and may contain errors.
sergio-sisternes-epam commentedon Sep 20, 2026
Thank you Dave Mead (@DaveMeadAdjust) for the report.
This issue is ready to be fixed. It is now in our status/accepted queue. Happy if anyone of the community want to pick it up and deliver it.
adity982 commentedon Sep 20, 2026
I plan to update the stale-cleanup diagnostic so it describes
dep_keyas the affected dependency rather than a deletion location, with focused tests for both logger renderers and no cleanup-path behavior changes.Dansatch commentedon Sep 30, 2026
Hi ADITYA (@adity982) , are you still working on this? I noticed there hasn’t been a branch or PR update since your comment. If you’re no longer working on it, I’d be happy to pick it up.
danielmeppiel commentedon Oct 2, 2026
Decision: approve
Area: project
Scope: Clarify stale-file cleanup wording in both logger renderers so dependency keys identify the affected dependency rather than a deletion location; complete the bounded change in PR #3120 with regression and command-level coverage and directly related documentation.
Done when: Both logger renderers report the affected dependency accurately; executed regression and command-level coverage verifies the wording and preserves existing cleanup behavior; directly related documentation reflects the change.
Out of scope: Changes to cleanup paths, deletion behavior, dependency resolution, or unrelated logging behavior. This approval does not authorize merge, policy waivers, or release targeting.
Review contact: Daniel Meppiel (@danielmeppiel)