From 692b8d3134880c232ad42478dd3b6cc038c8fcc2 Mon Sep 17 00:00:00 2001 From: Mark IJbema Date: Wed, 18 Mar 2026 17:21:04 +0100 Subject: [PATCH] fix(vscode): use global scope for dispose when MCP removed from global When an MCP exists in both project and global scope, both are removed. Use global scope for disposeCliInstance so the global config cache is also invalidated (global dispose is a superset of project dispose). --- packages/kilo-vscode/src/KiloProvider.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/kilo-vscode/src/KiloProvider.ts b/packages/kilo-vscode/src/KiloProvider.ts index f290ef35ad5..e58a4182e89 100644 --- a/packages/kilo-vscode/src/KiloProvider.ts +++ b/packages/kilo-vscode/src/KiloProvider.ts @@ -1359,12 +1359,14 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper const mp = this.getMarketplace() const stub = { id: name, type: "mcp" as const, name, description: "", url: "", content: "" } - // Try removing from project scope first, then global + // Remove from both scopes — an MCP could exist in project, global, or both const project = await mp.remove(stub, "project", workspace) const global = await mp.remove(stub, "global", workspace) if (project.success || global.success) { - const scope = project.success ? "project" : "global" + // Use global scope when removed from global (or both) so the global + // config cache is also invalidated; project scope is a subset. + const scope = global.success ? "global" : "project" await this.disposeCliInstance(scope) this.cachedConfigMessage = null await this.fetchAndSendConfig()