Make balanced smart context option the default (#1186)
<!-- This is an auto-generated description by cubic. --> ## Summary by cubic Set “balanced” as the default smart context mode. Users now get balanced when Smart Files Context is enabled and no mode is set; “conservative” must be explicitly selected. - **Refactors** - Default fallback to balanced in UI and engine (proSmartContextOption undefined -> "balanced"). - ProModeSelector saves "conservative" explicitly; selector reads undefined as balanced. - Updated schema and types to allow "balanced" | "conservative". - Engine payload now includes smart_context_mode with "balanced" by default; e2e tests and snapshots updated. - **Migration** - No action needed. Existing users without an explicit mode will use balanced by default; selecting conservative persists. <!-- End of auto-generated description by cubic. -->
This commit is contained in:
@@ -10,13 +10,13 @@ testSkipIfWindows("send message to engine", async ({ po }) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
testSkipIfWindows(
|
testSkipIfWindows(
|
||||||
"send message to engine - smart context balanced",
|
"send message to engine - smart context conservative",
|
||||||
async ({ po }) => {
|
async ({ po }) => {
|
||||||
await po.setUpDyadPro();
|
await po.setUpDyadPro();
|
||||||
const proModesDialog = await po.openProModesDialog({
|
const proModesDialog = await po.openProModesDialog({
|
||||||
location: "home-chat-input-container",
|
location: "home-chat-input-container",
|
||||||
});
|
});
|
||||||
await proModesDialog.setSmartContextMode("balanced");
|
await proModesDialog.setSmartContextMode("conservative");
|
||||||
await proModesDialog.close();
|
await proModesDialog.close();
|
||||||
await po.selectModel({ provider: "Google", model: "Gemini 2.5 Pro" });
|
await po.selectModel({ provider: "Google", model: "Gemini 2.5 Pro" });
|
||||||
await po.sendPrompt("[dump] tc=turbo-edits");
|
await po.sendPrompt("[dump] tc=turbo-edits");
|
||||||
|
|||||||
@@ -98,7 +98,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"enable_lazy_edits": true,
|
"enable_lazy_edits": true,
|
||||||
"enable_smart_files_context": true
|
"enable_smart_files_context": true,
|
||||||
|
"smart_context_mode": "balanced"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
|
|||||||
@@ -68,7 +68,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"enable_lazy_edits": true,
|
"enable_lazy_edits": true,
|
||||||
"enable_smart_files_context": true
|
"enable_smart_files_context": true,
|
||||||
|
"smart_context_mode": "balanced"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
|
|||||||
@@ -56,7 +56,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"enable_lazy_edits": true,
|
"enable_lazy_edits": true,
|
||||||
"enable_smart_files_context": false
|
"enable_smart_files_context": false,
|
||||||
|
"smart_context_mode": "balanced"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
|
|||||||
@@ -114,7 +114,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"enable_lazy_edits": true,
|
"enable_lazy_edits": true,
|
||||||
"enable_smart_files_context": false
|
"enable_smart_files_context": false,
|
||||||
|
"smart_context_mode": "balanced"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
|
|||||||
@@ -413,7 +413,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"enable_lazy_edits": true,
|
"enable_lazy_edits": true,
|
||||||
"enable_smart_files_context": false
|
"enable_smart_files_context": false,
|
||||||
|
"smart_context_mode": "balanced"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
|
|||||||
@@ -408,7 +408,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"enable_lazy_edits": true,
|
"enable_lazy_edits": true,
|
||||||
"enable_smart_files_context": true
|
"enable_smart_files_context": true,
|
||||||
|
"smart_context_mode": "balanced"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
|
|||||||
@@ -408,7 +408,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"enable_lazy_edits": true,
|
"enable_lazy_edits": true,
|
||||||
"enable_smart_files_context": true
|
"enable_smart_files_context": true,
|
||||||
|
"smart_context_mode": "balanced"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
|
|||||||
@@ -414,7 +414,7 @@
|
|||||||
],
|
],
|
||||||
"enable_lazy_edits": true,
|
"enable_lazy_edits": true,
|
||||||
"enable_smart_files_context": true,
|
"enable_smart_files_context": true,
|
||||||
"smart_context_mode": "balanced"
|
"smart_context_mode": "conservative"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
@@ -413,7 +413,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"enable_lazy_edits": true,
|
"enable_lazy_edits": true,
|
||||||
"enable_smart_files_context": true
|
"enable_smart_files_context": true,
|
||||||
|
"smart_context_mode": "balanced"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
|
|||||||
@@ -413,7 +413,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"enable_lazy_edits": true,
|
"enable_lazy_edits": true,
|
||||||
"enable_smart_files_context": true
|
"enable_smart_files_context": true,
|
||||||
|
"smart_context_mode": "balanced"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
"lastShownReleaseNotesVersion": "[scrubbed]",
|
"lastShownReleaseNotesVersion": "[scrubbed]",
|
||||||
"enableProLazyEditsMode": true,
|
"enableProLazyEditsMode": true,
|
||||||
"enableProSmartFilesContextMode": true,
|
"enableProSmartFilesContextMode": true,
|
||||||
|
"proSmartContextOption": "conservative",
|
||||||
"selectedTemplateId": "react",
|
"selectedTemplateId": "react",
|
||||||
"selectedChatMode": "build",
|
"selectedChatMode": "build",
|
||||||
"enableAutoFixProblems": false,
|
"enableAutoFixProblems": false,
|
||||||
|
|||||||
@@ -421,7 +421,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"enable_lazy_edits": true,
|
"enable_lazy_edits": true,
|
||||||
"enable_smart_files_context": true
|
"enable_smart_files_context": true,
|
||||||
|
"smart_context_mode": "balanced"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
|
|||||||
@@ -429,7 +429,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"enable_lazy_edits": true,
|
"enable_lazy_edits": true,
|
||||||
"enable_smart_files_context": true
|
"enable_smart_files_context": true,
|
||||||
|
"smart_context_mode": "balanced"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
|
|||||||
@@ -437,7 +437,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"enable_lazy_edits": true,
|
"enable_lazy_edits": true,
|
||||||
"enable_smart_files_context": true
|
"enable_smart_files_context": true,
|
||||||
|
"smart_context_mode": "balanced"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"headers": {
|
"headers": {
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export function ProModeSelector() {
|
|||||||
} else if (newValue === "conservative") {
|
} else if (newValue === "conservative") {
|
||||||
updateSettings({
|
updateSettings({
|
||||||
enableProSmartFilesContextMode: true,
|
enableProSmartFilesContextMode: true,
|
||||||
proSmartContextOption: undefined, // Conservative is the default when enabled but no option set
|
proSmartContextOption: "conservative",
|
||||||
});
|
});
|
||||||
} else if (newValue === "balanced") {
|
} else if (newValue === "balanced") {
|
||||||
updateSettings({
|
updateSettings({
|
||||||
@@ -197,8 +197,12 @@ function SmartContextSelector({
|
|||||||
if (settings?.proSmartContextOption === "balanced") {
|
if (settings?.proSmartContextOption === "balanced") {
|
||||||
return "balanced";
|
return "balanced";
|
||||||
}
|
}
|
||||||
// If enabled but no option set (undefined/falsey), it's conservative
|
if (settings?.proSmartContextOption === "conservative") {
|
||||||
return "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();
|
const currentValue = getCurrentValue();
|
||||||
|
|||||||
@@ -85,7 +85,8 @@ export async function getModelClient(
|
|||||||
? false
|
? false
|
||||||
: settings.enableProLazyEditsMode,
|
: settings.enableProLazyEditsMode,
|
||||||
enableSmartFilesContext: settings.enableProSmartFilesContextMode,
|
enableSmartFilesContext: settings.enableProSmartFilesContextMode,
|
||||||
smartContextMode: settings.proSmartContextOption,
|
// Keep in sync with getCurrentValue in ProModeSelector.tsx
|
||||||
|
smartContextMode: settings.proSmartContextOption ?? "balanced",
|
||||||
},
|
},
|
||||||
settings,
|
settings,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ or to provide a custom fetch implementation for e.g. testing.
|
|||||||
dyadOptions: {
|
dyadOptions: {
|
||||||
enableLazyEdits?: boolean;
|
enableLazyEdits?: boolean;
|
||||||
enableSmartFilesContext?: boolean;
|
enableSmartFilesContext?: boolean;
|
||||||
smartContextMode?: "balanced";
|
smartContextMode?: "balanced" | "conservative";
|
||||||
};
|
};
|
||||||
settings: UserSettings;
|
settings: UserSettings;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ export const UserSettingsSchema = z.object({
|
|||||||
thinkingBudget: z.enum(["low", "medium", "high"]).optional(),
|
thinkingBudget: z.enum(["low", "medium", "high"]).optional(),
|
||||||
enableProLazyEditsMode: z.boolean().optional(),
|
enableProLazyEditsMode: z.boolean().optional(),
|
||||||
enableProSmartFilesContextMode: z.boolean().optional(),
|
enableProSmartFilesContextMode: z.boolean().optional(),
|
||||||
proSmartContextOption: z.enum(["balanced"]).optional(),
|
proSmartContextOption: z.enum(["balanced", "conservative"]).optional(),
|
||||||
selectedTemplateId: z.string(),
|
selectedTemplateId: z.string(),
|
||||||
enableSupabaseWriteSqlMigration: z.boolean().optional(),
|
enableSupabaseWriteSqlMigration: z.boolean().optional(),
|
||||||
selectedChatMode: ChatModeSchema.optional(),
|
selectedChatMode: ChatModeSchema.optional(),
|
||||||
|
|||||||
Reference in New Issue
Block a user