From 08aa2ff02b550e239d8c206cc5e36ab8866faf66 Mon Sep 17 00:00:00 2001 From: AndyMik90 Date: Sat, 20 Dec 2025 12:18:39 +0100 Subject: [PATCH] fix: default agent profile to 'Auto (Optimized)' for all users MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add one-time migration to reset selectedAgentProfile to 'auto' for existing users. This ensures the optimized per-phase model selection is the default experience for everyone. The migration: - Runs once on settings load (tracked by _migratedAgentProfileToAuto flag) - Sets selectedAgentProfile to 'auto' - Persists the change to settings.json - Users can still change their preference afterward 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../main/ipc-handlers/settings-handlers.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/auto-claude-ui/src/main/ipc-handlers/settings-handlers.ts b/auto-claude-ui/src/main/ipc-handlers/settings-handlers.ts index 9297a838..30f06a7d 100644 --- a/auto-claude-ui/src/main/ipc-handlers/settings-handlers.ts +++ b/auto-claude-ui/src/main/ipc-handlers/settings-handlers.ts @@ -95,6 +95,7 @@ export function registerSettingsHandlers( IPC_CHANNELS.SETTINGS_GET, async (): Promise> => { let settings = { ...DEFAULT_APP_SETTINGS }; + let needsSave = false; if (existsSync(settingsPath)) { try { @@ -105,6 +106,15 @@ export function registerSettingsHandlers( } } + // Migration: Reset agent profile to 'auto' for existing users (one-time) + // This ensures all users get the optimized 'auto' profile as the default + const settingsAny = settings as Record; + if (!settingsAny._migratedAgentProfileToAuto) { + settings.selectedAgentProfile = 'auto'; + settingsAny._migratedAgentProfileToAuto = true; + needsSave = true; + } + // If no manual autoBuildPath is set, try to auto-detect if (!settings.autoBuildPath) { const detectedPath = detectAutoBuildSourcePath(); @@ -113,6 +123,15 @@ export function registerSettingsHandlers( } } + // Persist migration changes + if (needsSave) { + try { + writeFileSync(settingsPath, JSON.stringify(settings, null, 2)); + } catch { + // Ignore write errors during migration + } + } + return { success: true, data: settings as AppSettings }; } );