From 62e590323aa65c680132b586fbf738018444f038 Mon Sep 17 00:00:00 2001 From: Nimrod Gutman Date: Tue, 6 Jan 2026 18:05:28 +0200 Subject: [PATCH] fix(macOS): keep gateway config sync local --- apps/macos/Sources/Clawdbot/AppState.swift | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/macos/Sources/Clawdbot/AppState.swift b/apps/macos/Sources/Clawdbot/AppState.swift index 02f51aa54..8811ef58f 100644 --- a/apps/macos/Sources/Clawdbot/AppState.swift +++ b/apps/macos/Sources/Clawdbot/AppState.swift @@ -416,7 +416,8 @@ final class AppState { : nil Task { @MainActor in - var root = await ConfigStore.load() + // Keep app-only connection settings local to avoid overwriting remote gateway config. + var root = ClawdbotConfigFile.loadDict() var gateway = root["gateway"] as? [String: Any] ?? [:] var changed = false @@ -446,8 +447,12 @@ final class AppState { } guard changed else { return } - root["gateway"] = gateway - try? await ConfigStore.save(root) + if gateway.isEmpty { + root.removeValue(forKey: "gateway") + } else { + root["gateway"] = gateway + } + ClawdbotConfigFile.saveDict(root) } }