Merge pull request #7172 from Kilo-Org/mark/fix-global-config-dispose-all

fix(vscode): stop config update loop from flooding SSE and killing server
This commit is contained in:
Mark IJbema
2026-03-17 13:32:56 +01:00
committed by GitHub
4 changed files with 31 additions and 14 deletions
@@ -239,7 +239,12 @@ const AgentBehaviourTab: Component = () => {
current={defaultAgentOptions().find((o) => o.value === (config().default_agent ?? ""))}
value={(o) => o.value}
label={(o) => o.label}
onSelect={(o) => o && updateConfig({ default_agent: o.value || undefined })}
onSelect={(o) => {
if (!o) return
const next = o.value || undefined
if (next === (config().default_agent ?? undefined)) return
updateConfig({ default_agent: next })
}}
variant="secondary"
size="small"
triggerVariant="settings"
@@ -46,7 +46,12 @@ const DisplayTab: Component = () => {
current={LAYOUT_OPTIONS.find((o) => o.value === (config().layout ?? "auto"))}
value={(o) => o.value}
label={(o) => language.t(o.labelKey)}
onSelect={(o) => o && updateConfig({ layout: o.value as "auto" | "stretch" })}
onSelect={(o) => {
if (!o) return
const next = o.value as "auto" | "stretch"
if (next === (config().layout ?? "auto")) return
updateConfig({ layout: next })
}}
variant="secondary"
size="small"
triggerVariant="settings"
@@ -43,7 +43,12 @@ const ExperimentalTab: Component = () => {
current={SHARE_OPTIONS.find((o) => o.value === (config().share ?? "manual"))}
value={(o) => o.value}
label={(o) => language.t(o.labelKey)}
onSelect={(o) => o && updateConfig({ share: o.value as "manual" | "auto" | "disabled" })}
onSelect={(o) => {
if (!o) return
const next = o.value as "manual" | "auto" | "disabled"
if (next === (config().share ?? "manual")) return
updateConfig({ share: next })
}}
variant="secondary"
size="small"
triggerVariant="settings"
+13 -11
View File
@@ -1553,17 +1553,19 @@ export namespace Config {
global.reset()
void Instance.disposeAll()
.catch(() => undefined)
.finally(() => {
GlobalBus.emit("event", {
directory: "global",
payload: {
type: Event.Disposed.type,
properties: {},
},
})
})
// kilocode_change start - only reset config cache, don't dispose all instances.
// Instance.disposeAll() was destroying all session state, MCP connections, and
// in-flight operations across every project whenever any global config changed
// (e.g. removing a mode). The cache reset above is sufficient — consumers will
// pick up the new config on their next read.
GlobalBus.emit("event", {
directory: "global",
payload: {
type: Event.Disposed.type,
properties: {},
},
})
// kilocode_change end
return next
}