-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Context
unconfigurePack() in Configurator.swift unconditionally clears remaining.brewPackages = [] and remaining.plugins = [] after attempting removal, regardless of whether each individual removal succeeded or failed.
Problem
When brew uninstall or claude plugin remove fails during pack removal (mcs pack remove or deselection during mcs sync):
- No warning is emitted to the user
- The artifact is dropped from
PackArtifactRecordtracking - The failed removal will never be retried on subsequent syncs
- The user is left with an orphaned brew package or plugin with no indication anything went wrong
Contrast with other call sites
Both removeNewlyExcludedComponentArtifacts() and reconcileStaleArtifacts() correctly handle the .failed case by:
- Keeping the artifact in the record for retry
- Logging a warning to the user
Only unconfigurePack() silently discards failures.
Proposed Solution
Replace the unconditional bulk-clear with per-item tracking:
for package in artifacts.brewPackages {
let result = removeBrewArtifact(...)
switch result {
case .removed, .stillNeeded:
break
case .failed:
remaining.brewPackages.append(package)
output.warn(" Could not remove brew package '\(package)' — will retry on next sync")
}
}
// Remove the unconditional `remaining.brewPackages = []`Same pattern for plugins.
Notes
Discovered during PR review of #243. Pre-existing defect — not introduced by the refactor.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working