mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-10-31 03:46:24 +08:00
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:
committed by
Mark IJbema
parent
4aaf83da80
commit
cd2ec80756
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user