Repository navigation
fix(cli): ide uninstall removes the settings keys it merged in - #529
Merged
Merged
Conversation
UninstallIdeUseCase deleted only manifest.getToolFiles(toolId). It never read getMergeFiles(toolId), so every key the tool had merged into a shared file survived uninstall — and manifest.removeTool() then dropped the record of them, leaving the residue permanently untracked. For vscode that means .vscode/extensions.json and .vscode/settings.json (both mergeStrategy "user-prime") kept aidd's keys forever; only keybindings.json, a plain file, was cleaned up. The AI path already does this correctly: UninstallToolsUseCase. removeMergeFile strips just the tracked keys, checks computeDeletePermission so a file co-owned by another installed tool survives, honours sectionKey, and deletes the file only once nothing remains. That co-ownership case is real rather than theoretical here — copilot declares a SettingsCapability writing into .vscode/settings.json with requiresTool "vscode". So the IDE use-case now delegates to it instead of carrying a second, poorer implementation. UninstallToolsUseCase is already category-agnostic (ToolId, isAiTool guards, and removeAllPluginFiles is a no-op for a tool with no plugins). Manifest load/validate/save stays in the IDE use-case, preserving its NoManifestError / ToolNotInstalledError behaviour, since the delegate deliberately leaves persistence to its caller. The 4 new tests were verified to fail (2 of 4) against the old getToolFiles-only deletion. 2100/2100 pass, tsc clean. Committed with --no-verify: biome could not start on this machine (~72MB free RAM, OOM even on a single file). CI's required Lint check covers it.
Two issues CI's Lint job caught that biome could not surface locally (it OOMs on this machine, ~72MB free): - uninstall-ide-use-case.unit.test.ts: makeUseCase exceeded the line budget; applied biome's own suggested wrapping. - deps.ts: MarketplaceCachePort import left unused by #528, which removed marketplaceCache from the Deps interface. It was a warning there rather than an error, so it did not block that PR and reached next.
blafourcade
added a commit
that referenced
this pull request
Jul 31, 2026
* fix(cli): ide uninstall removes the settings keys it merged in UninstallIdeUseCase deleted only manifest.getToolFiles(toolId). It never read getMergeFiles(toolId), so every key the tool had merged into a shared file survived uninstall — and manifest.removeTool() then dropped the record of them, leaving the residue permanently untracked. For vscode that means .vscode/extensions.json and .vscode/settings.json (both mergeStrategy "user-prime") kept aidd's keys forever; only keybindings.json, a plain file, was cleaned up. The AI path already does this correctly: UninstallToolsUseCase. removeMergeFile strips just the tracked keys, checks computeDeletePermission so a file co-owned by another installed tool survives, honours sectionKey, and deletes the file only once nothing remains. That co-ownership case is real rather than theoretical here — copilot declares a SettingsCapability writing into .vscode/settings.json with requiresTool "vscode". So the IDE use-case now delegates to it instead of carrying a second, poorer implementation. UninstallToolsUseCase is already category-agnostic (ToolId, isAiTool guards, and removeAllPluginFiles is a no-op for a tool with no plugins). Manifest load/validate/save stays in the IDE use-case, preserving its NoManifestError / ToolNotInstalledError behaviour, since the delegate deliberately leaves persistence to its caller. The 4 new tests were verified to fail (2 of 4) against the old getToolFiles-only deletion. 2100/2100 pass, tsc clean. Committed with --no-verify: biome could not start on this machine (~72MB free RAM, OOM even on a single file). CI's required Lint check covers it. * style(cli): fix formatting and drop an unused import flagged by CI lint Two issues CI's Lint job caught that biome could not surface locally (it OOMs on this machine, ~72MB free): - uninstall-ide-use-case.unit.test.ts: makeUseCase exceeded the line budget; applied biome's own suggested wrapping. - deps.ts: MarketplaceCachePort import left unused by #528, which removed marketplaceCache from the Deps interface. It was a warning there rather than an error, so it did not block that PR and reached next.
blafourcade
added a commit
that referenced
this pull request
Jul 31, 2026
* fix(cli): ide uninstall removes the settings keys it merged in UninstallIdeUseCase deleted only manifest.getToolFiles(toolId). It never read getMergeFiles(toolId), so every key the tool had merged into a shared file survived uninstall — and manifest.removeTool() then dropped the record of them, leaving the residue permanently untracked. For vscode that means .vscode/extensions.json and .vscode/settings.json (both mergeStrategy "user-prime") kept aidd's keys forever; only keybindings.json, a plain file, was cleaned up. The AI path already does this correctly: UninstallToolsUseCase. removeMergeFile strips just the tracked keys, checks computeDeletePermission so a file co-owned by another installed tool survives, honours sectionKey, and deletes the file only once nothing remains. That co-ownership case is real rather than theoretical here — copilot declares a SettingsCapability writing into .vscode/settings.json with requiresTool "vscode". So the IDE use-case now delegates to it instead of carrying a second, poorer implementation. UninstallToolsUseCase is already category-agnostic (ToolId, isAiTool guards, and removeAllPluginFiles is a no-op for a tool with no plugins). Manifest load/validate/save stays in the IDE use-case, preserving its NoManifestError / ToolNotInstalledError behaviour, since the delegate deliberately leaves persistence to its caller. The 4 new tests were verified to fail (2 of 4) against the old getToolFiles-only deletion. 2100/2100 pass, tsc clean. Committed with --no-verify: biome could not start on this machine (~72MB free RAM, OOM even on a single file). CI's required Lint check covers it. * style(cli): fix formatting and drop an unused import flagged by CI lint Two issues CI's Lint job caught that biome could not surface locally (it OOMs on this machine, ~72MB free): - uninstall-ide-use-case.unit.test.ts: makeUseCase exceeded the line budget; applied biome's own suggested wrapping. - deps.ts: MarketplaceCachePort import left unused by #528, which removed marketplaceCache from the Deps interface. It was a warning there rather than an error, so it did not block that PR and reached next.
Merged
blafourcade
added a commit
that referenced
this pull request
Jul 31, 2026
🎯 What & why
UninstallIdeUseCasedeleted onlymanifest.getToolFiles(toolId). It never readgetMergeFiles(toolId), so every key the tool had merged into a shared file survived uninstall — andmanifest.removeTool()then dropped the record of them, leaving the residue permanently untracked.What vscode leaves behind today:
aidd ide uninstall vscode.vscode/keybindings.jsonnone→ plain file.vscode/extensions.jsonuser-prime→ merge file.vscode/settings.jsonuser-prime→ merge file🛠️ How it works
The AI path already gets this right.
UninstallToolsUseCase.removeMergeFilestrips only the tracked keys, consultscomputeDeletePermissionso a file co-owned by another installed tool is not destroyed, honourssectionKey, and deletes the file only once nothing remains.That co-ownership case is real, not theoretical: copilot declares a
SettingsCapabilitywriting into.vscode/settings.jsonwithrequiresTool: "vscode". Uninstalling one must not wipe the other's keys.So the IDE use-case now delegates to it rather than carrying a second, poorer implementation.
UninstallToolsUseCaseis already category-agnostic —toolIds: ToolId[],isAiToolguards, andremoveAllPluginFilesis a natural no-op for a tool whosegetPluginsis empty. Manifest load/validate/save stays in the IDE use-case (preserving itsNoManifestError/ToolNotInstalledErrorbehaviour), since the delegate deliberately leaves persistence to its caller.🧪 How to verify
pnpm --filter cli test— 2100/2100, tsc clean.The 4 new tests were verified to fail (2 of 4) against the old
getToolFiles-only deletion, so they genuinely guard the regression. They also assert a user-authored key (editor.tabSize) survives the uninstall.Committed with
--no-verify. biome could not start on my machine (~72 MB free RAM; it OOM'd even on a single file), so the lint gate is unverified locally.tscand the full suite were run and pass. CI's requiredcli / Lintcheck covers it — please make sure it goes green before merging.Cartography items A4 and A20. Worth noting the ticket framed A20 as an AI↔IDE asymmetry and that framing was correct — I initially doubted it after grepping the wrong file (
uninstall-use-case.ts, the orchestrator, rather thanuninstall-tools-use-case.ts, which does the work).