fix(vscode): re-fetch merged config after settings update to prevent revert

After updating global config, the extension was sending back the global-only
config response to the webview. This replaced the full merged config (which
includes project-level values) with only global values, causing settings UI
controls to flicker and revert to their previous state.

Now re-fetches the complete merged config via config.get() after the global
update succeeds, ensuring the webview always has the properly resolved config
from all layers.

Fixes #7202
This commit is contained in:
kiloconnect[bot]
2026-03-18 09:27:32 +01:00
committed by Mark IJbema
parent 4aaf83da80
commit cd2ec80756
+10 -3
View File
@@ -1598,13 +1598,20 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
}
try {
const { data: updated } = await this.client.global.config.update({ config: partial }, { throwOnError: true })
await this.client.global.config.update({ config: partial }, { throwOnError: true })
// Re-fetch the full merged config (global + project + all layers) so the
// webview receives the complete resolved config, not just global-only data.
// Without this, the global-only response would overwrite project-level
// values in the webview, causing settings to flicker and revert.
const dir = this.getWorkspaceDirectory()
const { data: merged } = await this.client.config.get({ directory: dir }, { throwOnError: true })
const message = {
type: "configUpdated",
config: updated,
config: merged,
}
this.cachedConfigMessage = { type: "configLoaded", config: updated }
this.cachedConfigMessage = { type: "configLoaded", config: merged }
this.postMessage(message)
} catch (error) {
console.error("[Kilo New] KiloProvider: Failed to update config:", error)