diff --git a/e2e-tests/engine.spec.ts b/e2e-tests/engine.spec.ts index d8d432f..693165b 100644 --- a/e2e-tests/engine.spec.ts +++ b/e2e-tests/engine.spec.ts @@ -10,13 +10,13 @@ testSkipIfWindows("send message to engine", async ({ po }) => { }); testSkipIfWindows( - "send message to engine - smart context balanced", + "send message to engine - smart context conservative", async ({ po }) => { await po.setUpDyadPro(); const proModesDialog = await po.openProModesDialog({ location: "home-chat-input-container", }); - await proModesDialog.setSmartContextMode("balanced"); + await proModesDialog.setSmartContextMode("conservative"); await proModesDialog.close(); await po.selectModel({ provider: "Google", model: "Gemini 2.5 Pro" }); await po.sendPrompt("[dump] tc=turbo-edits"); diff --git a/e2e-tests/snapshots/context_manage.spec.ts_manage-context---smart-context---auto-includes-only-1.txt b/e2e-tests/snapshots/context_manage.spec.ts_manage-context---smart-context---auto-includes-only-1.txt index d9aa061..c2e539c 100644 --- a/e2e-tests/snapshots/context_manage.spec.ts_manage-context---smart-context---auto-includes-only-1.txt +++ b/e2e-tests/snapshots/context_manage.spec.ts_manage-context---smart-context---auto-includes-only-1.txt @@ -98,7 +98,8 @@ } ], "enable_lazy_edits": true, - "enable_smart_files_context": true + "enable_smart_files_context": true, + "smart_context_mode": "balanced" } }, "headers": { diff --git a/e2e-tests/snapshots/context_manage.spec.ts_manage-context---smart-context-1.txt b/e2e-tests/snapshots/context_manage.spec.ts_manage-context---smart-context-1.txt index 94c022c..e67f4db 100644 --- a/e2e-tests/snapshots/context_manage.spec.ts_manage-context---smart-context-1.txt +++ b/e2e-tests/snapshots/context_manage.spec.ts_manage-context---smart-context-1.txt @@ -68,7 +68,8 @@ } ], "enable_lazy_edits": true, - "enable_smart_files_context": true + "enable_smart_files_context": true, + "smart_context_mode": "balanced" } }, "headers": { diff --git a/e2e-tests/snapshots/context_manage.spec.ts_manage-context---smart-context-3.txt b/e2e-tests/snapshots/context_manage.spec.ts_manage-context---smart-context-3.txt index fb4b834..d34619f 100644 --- a/e2e-tests/snapshots/context_manage.spec.ts_manage-context---smart-context-3.txt +++ b/e2e-tests/snapshots/context_manage.spec.ts_manage-context---smart-context-3.txt @@ -56,7 +56,8 @@ } ], "enable_lazy_edits": true, - "enable_smart_files_context": false + "enable_smart_files_context": false, + "smart_context_mode": "balanced" } }, "headers": { diff --git a/e2e-tests/snapshots/context_manage.spec.ts_manage-context---smart-context-4.txt b/e2e-tests/snapshots/context_manage.spec.ts_manage-context---smart-context-4.txt index 24d09a7..35c9a03 100644 --- a/e2e-tests/snapshots/context_manage.spec.ts_manage-context---smart-context-4.txt +++ b/e2e-tests/snapshots/context_manage.spec.ts_manage-context---smart-context-4.txt @@ -114,7 +114,8 @@ } ], "enable_lazy_edits": true, - "enable_smart_files_context": false + "enable_smart_files_context": false, + "smart_context_mode": "balanced" } }, "headers": { diff --git a/e2e-tests/snapshots/engine.spec.ts_regular-auto-should-send-message-to-engine-1.txt b/e2e-tests/snapshots/engine.spec.ts_regular-auto-should-send-message-to-engine-1.txt index de0be17..3fbec28 100644 --- a/e2e-tests/snapshots/engine.spec.ts_regular-auto-should-send-message-to-engine-1.txt +++ b/e2e-tests/snapshots/engine.spec.ts_regular-auto-should-send-message-to-engine-1.txt @@ -413,7 +413,8 @@ } ], "enable_lazy_edits": true, - "enable_smart_files_context": false + "enable_smart_files_context": false, + "smart_context_mode": "balanced" } }, "headers": { diff --git a/e2e-tests/snapshots/engine.spec.ts_send-message-to-engine---anthropic-claude-sonnet-4-1.txt b/e2e-tests/snapshots/engine.spec.ts_send-message-to-engine---anthropic-claude-sonnet-4-1.txt index 9240ce1..8d1176d 100644 --- a/e2e-tests/snapshots/engine.spec.ts_send-message-to-engine---anthropic-claude-sonnet-4-1.txt +++ b/e2e-tests/snapshots/engine.spec.ts_send-message-to-engine---anthropic-claude-sonnet-4-1.txt @@ -408,7 +408,8 @@ } ], "enable_lazy_edits": true, - "enable_smart_files_context": true + "enable_smart_files_context": true, + "smart_context_mode": "balanced" } }, "headers": { diff --git a/e2e-tests/snapshots/engine.spec.ts_send-message-to-engine---openai-gpt-5-1.txt b/e2e-tests/snapshots/engine.spec.ts_send-message-to-engine---openai-gpt-5-1.txt index 7ec315e..4d49f0f 100644 --- a/e2e-tests/snapshots/engine.spec.ts_send-message-to-engine---openai-gpt-5-1.txt +++ b/e2e-tests/snapshots/engine.spec.ts_send-message-to-engine---openai-gpt-5-1.txt @@ -408,7 +408,8 @@ } ], "enable_lazy_edits": true, - "enable_smart_files_context": true + "enable_smart_files_context": true, + "smart_context_mode": "balanced" } }, "headers": { diff --git a/e2e-tests/snapshots/engine.spec.ts_send-message-to-engine---smart-context-balanced-1.aria.yml b/e2e-tests/snapshots/engine.spec.ts_send-message-to-engine---smart-context-conservative-1.aria.yml similarity index 100% rename from e2e-tests/snapshots/engine.spec.ts_send-message-to-engine---smart-context-balanced-1.aria.yml rename to e2e-tests/snapshots/engine.spec.ts_send-message-to-engine---smart-context-conservative-1.aria.yml diff --git a/e2e-tests/snapshots/engine.spec.ts_send-message-to-engine---smart-context-balanced-1.txt b/e2e-tests/snapshots/engine.spec.ts_send-message-to-engine---smart-context-conservative-1.txt similarity index 99% rename from e2e-tests/snapshots/engine.spec.ts_send-message-to-engine---smart-context-balanced-1.txt rename to e2e-tests/snapshots/engine.spec.ts_send-message-to-engine---smart-context-conservative-1.txt index 659e63c..d8734f3 100644 --- a/e2e-tests/snapshots/engine.spec.ts_send-message-to-engine---smart-context-balanced-1.txt +++ b/e2e-tests/snapshots/engine.spec.ts_send-message-to-engine---smart-context-conservative-1.txt @@ -414,7 +414,7 @@ ], "enable_lazy_edits": true, "enable_smart_files_context": true, - "smart_context_mode": "balanced" + "smart_context_mode": "conservative" } }, "headers": { diff --git a/e2e-tests/snapshots/engine.spec.ts_send-message-to-engine-1.txt b/e2e-tests/snapshots/engine.spec.ts_send-message-to-engine-1.txt index 50ae7a2..659e63c 100644 --- a/e2e-tests/snapshots/engine.spec.ts_send-message-to-engine-1.txt +++ b/e2e-tests/snapshots/engine.spec.ts_send-message-to-engine-1.txt @@ -413,7 +413,8 @@ } ], "enable_lazy_edits": true, - "enable_smart_files_context": true + "enable_smart_files_context": true, + "smart_context_mode": "balanced" } }, "headers": { diff --git a/e2e-tests/snapshots/engine.spec.ts_smart-auto-should-send-message-to-engine-1.txt b/e2e-tests/snapshots/engine.spec.ts_smart-auto-should-send-message-to-engine-1.txt index cf9e74a..5077082 100644 --- a/e2e-tests/snapshots/engine.spec.ts_smart-auto-should-send-message-to-engine-1.txt +++ b/e2e-tests/snapshots/engine.spec.ts_smart-auto-should-send-message-to-engine-1.txt @@ -413,7 +413,8 @@ } ], "enable_lazy_edits": true, - "enable_smart_files_context": true + "enable_smart_files_context": true, + "smart_context_mode": "balanced" } }, "headers": { diff --git a/e2e-tests/snapshots/smart_context_options.spec.ts_switching-smart-context-mode-saves-the-right-setting-4.txt b/e2e-tests/snapshots/smart_context_options.spec.ts_switching-smart-context-mode-saves-the-right-setting-4.txt index c2c5fc5..de586c9 100644 --- a/e2e-tests/snapshots/smart_context_options.spec.ts_switching-smart-context-mode-saves-the-right-setting-4.txt +++ b/e2e-tests/snapshots/smart_context_options.spec.ts_switching-smart-context-mode-saves-the-right-setting-4.txt @@ -19,6 +19,7 @@ "lastShownReleaseNotesVersion": "[scrubbed]", "enableProLazyEditsMode": true, "enableProSmartFilesContextMode": true, + "proSmartContextOption": "conservative", "selectedTemplateId": "react", "selectedChatMode": "build", "enableAutoFixProblems": false, diff --git a/e2e-tests/snapshots/thinking_budget.spec.ts_thinking-budget-2.txt b/e2e-tests/snapshots/thinking_budget.spec.ts_thinking-budget-2.txt index 004d590..72c950b 100644 --- a/e2e-tests/snapshots/thinking_budget.spec.ts_thinking-budget-2.txt +++ b/e2e-tests/snapshots/thinking_budget.spec.ts_thinking-budget-2.txt @@ -421,7 +421,8 @@ } ], "enable_lazy_edits": true, - "enable_smart_files_context": true + "enable_smart_files_context": true, + "smart_context_mode": "balanced" } }, "headers": { diff --git a/e2e-tests/snapshots/thinking_budget.spec.ts_thinking-budget-4.txt b/e2e-tests/snapshots/thinking_budget.spec.ts_thinking-budget-4.txt index 1c0aff9..a176adc 100644 --- a/e2e-tests/snapshots/thinking_budget.spec.ts_thinking-budget-4.txt +++ b/e2e-tests/snapshots/thinking_budget.spec.ts_thinking-budget-4.txt @@ -429,7 +429,8 @@ } ], "enable_lazy_edits": true, - "enable_smart_files_context": true + "enable_smart_files_context": true, + "smart_context_mode": "balanced" } }, "headers": { diff --git a/e2e-tests/snapshots/thinking_budget.spec.ts_thinking-budget-6.txt b/e2e-tests/snapshots/thinking_budget.spec.ts_thinking-budget-6.txt index 0ad1390..27127f2 100644 --- a/e2e-tests/snapshots/thinking_budget.spec.ts_thinking-budget-6.txt +++ b/e2e-tests/snapshots/thinking_budget.spec.ts_thinking-budget-6.txt @@ -437,7 +437,8 @@ } ], "enable_lazy_edits": true, - "enable_smart_files_context": true + "enable_smart_files_context": true, + "smart_context_mode": "balanced" } }, "headers": { diff --git a/src/components/ProModeSelector.tsx b/src/components/ProModeSelector.tsx index ce5bc87..4fe28f5 100644 --- a/src/components/ProModeSelector.tsx +++ b/src/components/ProModeSelector.tsx @@ -36,7 +36,7 @@ export function ProModeSelector() { } else if (newValue === "conservative") { updateSettings({ enableProSmartFilesContextMode: true, - proSmartContextOption: undefined, // Conservative is the default when enabled but no option set + proSmartContextOption: "conservative", }); } else if (newValue === "balanced") { updateSettings({ @@ -197,8 +197,12 @@ function SmartContextSelector({ if (settings?.proSmartContextOption === "balanced") { return "balanced"; } - // If enabled but no option set (undefined/falsey), it's conservative - return "conservative"; + if (settings?.proSmartContextOption === "conservative") { + return "conservative"; + } + // Keep in sync with getModelClient in get_model_client.ts + // If enabled but no option set (undefined/falsey), it's balanced + return "balanced"; }; const currentValue = getCurrentValue(); diff --git a/src/ipc/utils/get_model_client.ts b/src/ipc/utils/get_model_client.ts index d7390a9..2ff8a80 100644 --- a/src/ipc/utils/get_model_client.ts +++ b/src/ipc/utils/get_model_client.ts @@ -85,7 +85,8 @@ export async function getModelClient( ? false : settings.enableProLazyEditsMode, enableSmartFilesContext: settings.enableProSmartFilesContextMode, - smartContextMode: settings.proSmartContextOption, + // Keep in sync with getCurrentValue in ProModeSelector.tsx + smartContextMode: settings.proSmartContextOption ?? "balanced", }, settings, }) diff --git a/src/ipc/utils/llm_engine_provider.ts b/src/ipc/utils/llm_engine_provider.ts index 7378996..780b750 100644 --- a/src/ipc/utils/llm_engine_provider.ts +++ b/src/ipc/utils/llm_engine_provider.ts @@ -44,7 +44,7 @@ or to provide a custom fetch implementation for e.g. testing. dyadOptions: { enableLazyEdits?: boolean; enableSmartFilesContext?: boolean; - smartContextMode?: "balanced"; + smartContextMode?: "balanced" | "conservative"; }; settings: UserSettings; } diff --git a/src/lib/schemas.ts b/src/lib/schemas.ts index dd2d10e..097a283 100644 --- a/src/lib/schemas.ts +++ b/src/lib/schemas.ts @@ -164,7 +164,7 @@ export const UserSettingsSchema = z.object({ thinkingBudget: z.enum(["low", "medium", "high"]).optional(), enableProLazyEditsMode: z.boolean().optional(), enableProSmartFilesContextMode: z.boolean().optional(), - proSmartContextOption: z.enum(["balanced"]).optional(), + proSmartContextOption: z.enum(["balanced", "conservative"]).optional(), selectedTemplateId: z.string(), enableSupabaseWriteSqlMigration: z.boolean().optional(), selectedChatMode: ChatModeSchema.optional(),