mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-21 05:52:35 +08:00
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).
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user