From a9d399699eb6d3edae544b942a098bf0e5895aed Mon Sep 17 00:00:00 2001 From: OpeOginni <107570612+OpeOginni@users.noreply.github.com> Date: Fri, 1 May 2026 03:27:38 +0200 Subject: [PATCH] fix(desktop): Prevent Model response Interruption when opening settings dialog (#25114) --- packages/app/src/components/settings-general.tsx | 1 + packages/opencode/src/config/config.ts | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/app/src/components/settings-general.tsx b/packages/app/src/components/settings-general.tsx index 8060ae94d9..535bd72064 100644 --- a/packages/app/src/components/settings-general.tsx +++ b/packages/app/src/components/settings-general.tsx @@ -329,6 +329,7 @@ export const SettingsGeneral: Component = () => { label={(o) => o.label} onSelect={(option) => { if (!option) return + if (option.value === currentShell()) return globalSync.updateConfig({ shell: option.value }) }} variant="secondary" diff --git a/packages/opencode/src/config/config.ts b/packages/opencode/src/config/config.ts index 817f8c3e38..c79e950e90 100644 --- a/packages/opencode/src/config/config.ts +++ b/packages/opencode/src/config/config.ts @@ -759,18 +759,23 @@ export const layer = Layer.effect( const patch = writableGlobal(config) let next: Info + let changed: boolean if (!file.endsWith(".jsonc")) { const existing = ConfigParse.effectSchema(Info, ConfigParse.jsonc(before, file), file) const merged = mergeDeep(writable(existing), patch) - yield* fs.writeFileString(file, JSON.stringify(merged, null, 2)).pipe(Effect.orDie) + const serialized = JSON.stringify(merged, null, 2) + changed = serialized !== before + if (changed) yield* fs.writeFileString(file, serialized).pipe(Effect.orDie) next = merged } else { const updated = patchJsonc(before, patch) next = ConfigParse.effectSchema(Info, ConfigParse.jsonc(updated, file), file) - yield* fs.writeFileString(file, updated).pipe(Effect.orDie) + changed = updated !== before + if (changed) yield* fs.writeFileString(file, updated).pipe(Effect.orDie) } - yield* invalidate() + // Only tear down running instances if the config actually changed. + if (changed) yield* invalidate() return next })