Description
The macOS app uses config.set to save configuration changes, which replaces the entire config file. This causes gateway.auth settings (and potentially other config blocks the app UI does not understand) to be wiped when the app saves any config change.
Steps to Reproduce
- Set gateway auth via CLI:
moltbot config set gateway.auth.mode token
moltbot config set gateway.auth.token "my-secret-token"
- Start the macOS app
- Make any change via the app UI (e.g., toggle a channel setting)
- Observe the gateway restart fails with:
gateway auth mode is token, but no token was configured
Expected Behavior
The gateway.auth configuration should be preserved when the app saves other config changes.
Root Cause
In apps/macos/Sources/Moltbot/ConfigStore.swift:101:
_ = try await GatewayConnection.shared.requestRaw(
method: .configSet, // <-- full replace
params: params,
timeoutMs: 10000)
The app uses config.set which replaces the entire config. If the app internal representation does not include gateway.auth, it gets dropped.
Suggested Fix
Use config.patch instead of config.set to merge changes, or ensure the app preserves all unknown config keys when round-tripping.
Logs
2026-01-30T01:04:12.213Z [reload] config change detected; evaluating reload (meta.lastTouchedAt, agents.defaults.contextPruning, gateway.auth)
2026-01-30T01:04:12.215Z [reload] config change requires gateway restart (meta.lastTouchedAt, gateway.auth)
...
2026-01-30T01:04:12.666Z Gateway failed to start: Error: gateway auth mode is token, but no token was configured
Environment
- macOS Sequoia
- Moltbot version: 2026.1.29
Description
The macOS app uses
config.setto save configuration changes, which replaces the entire config file. This causesgateway.authsettings (and potentially other config blocks the app UI does not understand) to be wiped when the app saves any config change.Steps to Reproduce
gateway auth mode is token, but no token was configuredExpected Behavior
The
gateway.authconfiguration should be preserved when the app saves other config changes.Root Cause
In
apps/macos/Sources/Moltbot/ConfigStore.swift:101:The app uses
config.setwhich replaces the entire config. If the app internal representation does not includegateway.auth, it gets dropped.Suggested Fix
Use
config.patchinstead ofconfig.setto merge changes, or ensure the app preserves all unknown config keys when round-tripping.Logs
Environment