mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Fix default settings overriding user's recently used models
Separate EMPTY_AI_SETTINGS (for initial state and error fallback) from OPENCODE_DEFAULT_SETTINGS (for genuinely new users only). Previously, readAISettings returned OPENCODE_DEFAULT_SETTINGS on any error, which could overwrite an existing user's recentlyUsedModels with ['opencode/big-pickle']. Now the error path returns empty settings, and OPENCODE defaults are only applied when no providers are configured.
This commit is contained in:
5 files changed
+58
-15
No files matched your search
@@ -3,7 +3,14 @@ import { AI_PROVIDER_PRESETS } from '@/lib/aiProviderPresets';
|
||||
|
||||
const opencodePreset = AI_PROVIDER_PRESETS.find((p) => p.id === 'opencode')!;
|
||||
|
||||
/** Default AI settings with OpenCode Zen pre-configured and big-pickle selected. */
|
||||
/** Empty AI settings used as initial state and error fallback. Won't overwrite user data. */
|
||||
export const EMPTY_AI_SETTINGS: AISettings = {
|
||||
providers: [],
|
||||
recentlyUsedModels: [],
|
||||
mcpServers: {},
|
||||
};
|
||||
|
||||
/** Default AI settings with OpenCode Zen pre-configured and big-pickle selected. Only for genuinely new users. */
|
||||
export const OPENCODE_DEFAULT_SETTINGS: AISettings = {
|
||||
providers: [
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user