fix: default agent profile to 'Auto (Optimized)' for all users
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 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
37ace0a39a
commit
08aa2ff02b
@@ -95,6 +95,7 @@ export function registerSettingsHandlers(
|
|||||||
IPC_CHANNELS.SETTINGS_GET,
|
IPC_CHANNELS.SETTINGS_GET,
|
||||||
async (): Promise<IPCResult<AppSettings>> => {
|
async (): Promise<IPCResult<AppSettings>> => {
|
||||||
let settings = { ...DEFAULT_APP_SETTINGS };
|
let settings = { ...DEFAULT_APP_SETTINGS };
|
||||||
|
let needsSave = false;
|
||||||
|
|
||||||
if (existsSync(settingsPath)) {
|
if (existsSync(settingsPath)) {
|
||||||
try {
|
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<string, unknown>;
|
||||||
|
if (!settingsAny._migratedAgentProfileToAuto) {
|
||||||
|
settings.selectedAgentProfile = 'auto';
|
||||||
|
settingsAny._migratedAgentProfileToAuto = true;
|
||||||
|
needsSave = true;
|
||||||
|
}
|
||||||
|
|
||||||
// If no manual autoBuildPath is set, try to auto-detect
|
// If no manual autoBuildPath is set, try to auto-detect
|
||||||
if (!settings.autoBuildPath) {
|
if (!settings.autoBuildPath) {
|
||||||
const detectedPath = detectAutoBuildSourcePath();
|
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 };
|
return { success: true, data: settings as AppSettings };
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user