From a07a9e1b803fee9e0447a434e03a99827cfd1a64 Mon Sep 17 00:00:00 2001 From: Hannes Rudolph Date: Mon, 22 Dec 2025 23:26:42 -0700 Subject: [PATCH 1/2] chore: remove diffEnabled and fuzzyMatchThreshold settings Native tool calling makes these controls obsolete. Removes: - diffEnabled and fuzzyMatchThreshold from provider settings types - DiffSettingsControl UI component - Related translations from all 18 locale files - System prompt diffEnabled parameter - Conditional apply_diff tool filtering based on diffEnabled - Associated tests and migrations --- packages/types/src/cloud.ts | 1 - packages/types/src/global-settings.ts | 5 -- packages/types/src/provider-settings.ts | 2 - packages/types/src/task.ts | 1 - .../presentAssistantMessage.ts | 2 +- src/core/config/ProviderSettingsManager.ts | 44 ---------- .../__tests__/getEnvironmentDetails.spec.ts | 1 - .../__tests__/add-custom-instructions.spec.ts | 5 -- .../__tests__/custom-system-prompt.spec.ts | 3 - .../prompts/__tests__/system-prompt.spec.ts | 88 ------------------- src/core/prompts/system.ts | 20 +---- .../prompts/tools/filter-tools-for-mode.ts | 5 -- src/core/task/Task.ts | 37 +++----- src/core/task/__tests__/Task.spec.ts | 33 +------ src/core/task/build-tools.ts | 3 - src/core/webview/ClineProvider.ts | 24 +---- .../webview/__tests__/ClineProvider.spec.ts | 52 +---------- src/core/webview/generateSystemPrompt.ts | 7 +- src/shared/ExtensionMessage.ts | 4 +- .../src/components/settings/ApiOptions.tsx | 6 -- .../settings/DiffSettingsControl.tsx | 68 -------------- .../src/components/settings/SettingsView.tsx | 4 - .../settings/__tests__/ApiOptions.spec.tsx | 38 +------- .../src/context/ExtensionStateContext.tsx | 7 -- webview-ui/src/i18n/locales/ca/settings.json | 4 - webview-ui/src/i18n/locales/de/settings.json | 4 - webview-ui/src/i18n/locales/en/settings.json | 4 - webview-ui/src/i18n/locales/es/settings.json | 4 - webview-ui/src/i18n/locales/fr/settings.json | 4 - webview-ui/src/i18n/locales/hi/settings.json | 4 - webview-ui/src/i18n/locales/id/settings.json | 4 - webview-ui/src/i18n/locales/it/settings.json | 4 - webview-ui/src/i18n/locales/ja/settings.json | 4 - webview-ui/src/i18n/locales/ko/settings.json | 4 - webview-ui/src/i18n/locales/nl/settings.json | 4 - webview-ui/src/i18n/locales/pl/settings.json | 4 - .../src/i18n/locales/pt-BR/settings.json | 4 - webview-ui/src/i18n/locales/ru/settings.json | 4 - webview-ui/src/i18n/locales/tr/settings.json | 4 - webview-ui/src/i18n/locales/vi/settings.json | 4 - .../src/i18n/locales/zh-CN/settings.json | 4 - .../src/i18n/locales/zh-TW/settings.json | 4 - 42 files changed, 27 insertions(+), 505 deletions(-) delete mode 100644 webview-ui/src/components/settings/DiffSettingsControl.tsx diff --git a/packages/types/src/cloud.ts b/packages/types/src/cloud.ts index 9d365b65254..c29559d89e6 100644 --- a/packages/types/src/cloud.ts +++ b/packages/types/src/cloud.ts @@ -94,7 +94,6 @@ export type OrganizationAllowList = z.infer export const organizationDefaultSettingsSchema = globalSettingsSchema .pick({ enableCheckpoints: true, - fuzzyMatchThreshold: true, maxOpenTabsContext: true, maxReadFileLine: true, maxWorkspaceFiles: true, diff --git a/packages/types/src/global-settings.ts b/packages/types/src/global-settings.ts index a11fae1e117..f8283c36137 100644 --- a/packages/types/src/global-settings.ts +++ b/packages/types/src/global-settings.ts @@ -162,8 +162,6 @@ export const globalSettingsSchema = z.object({ diagnosticsEnabled: z.boolean().optional(), rateLimitSeconds: z.number().optional(), - diffEnabled: z.boolean().optional(), - fuzzyMatchThreshold: z.number().optional(), experiments: experimentsSchema.optional(), codebaseIndexModels: codebaseIndexModelsSchema.optional(), @@ -341,9 +339,6 @@ export const EVALS_SETTINGS: RooCodeSettings = { diagnosticsEnabled: true, - diffEnabled: true, - fuzzyMatchThreshold: 1, - enableCheckpoints: false, rateLimitSeconds: 0, diff --git a/packages/types/src/provider-settings.ts b/packages/types/src/provider-settings.ts index 443cbafcf16..0e6eccbb731 100644 --- a/packages/types/src/provider-settings.ts +++ b/packages/types/src/provider-settings.ts @@ -168,9 +168,7 @@ export type ProviderSettingsEntry = z.infer const baseProviderSettingsSchema = z.object({ includeMaxTokens: z.boolean().optional(), - diffEnabled: z.boolean().optional(), todoListEnabled: z.boolean().optional(), - fuzzyMatchThreshold: z.number().optional(), modelTemperature: z.number().nullish(), rateLimitSeconds: z.number().optional(), consecutiveMistakeLimit: z.number().min(0).optional(), diff --git a/packages/types/src/task.ts b/packages/types/src/task.ts index 3f6a0aa581c..d735073b9a7 100644 --- a/packages/types/src/task.ts +++ b/packages/types/src/task.ts @@ -91,7 +91,6 @@ export type TaskProviderEvents = { export interface CreateTaskOptions { enableDiff?: boolean enableCheckpoints?: boolean - fuzzyMatchThreshold?: number consecutiveMistakeLimit?: number experiments?: Record initialTodos?: TodoItem[] diff --git a/src/core/assistant-message/presentAssistantMessage.ts b/src/core/assistant-message/presentAssistantMessage.ts index c1876b8cd08..568f307b417 100644 --- a/src/core/assistant-message/presentAssistantMessage.ts +++ b/src/core/assistant-message/presentAssistantMessage.ts @@ -723,7 +723,7 @@ export async function presentAssistantMessage(cline: Task) { block.name as ToolName, mode ?? defaultModeSlug, customModes ?? [], - { apply_diff: cline.diffEnabled }, + {}, block.params, stateExperiments, includedTools, diff --git a/src/core/config/ProviderSettingsManager.ts b/src/core/config/ProviderSettingsManager.ts index 420ab332b24..c0683fe9814 100644 --- a/src/core/config/ProviderSettingsManager.ts +++ b/src/core/config/ProviderSettingsManager.ts @@ -43,7 +43,6 @@ export const providerProfilesSchema = z.object({ migrations: z .object({ rateLimitSecondsMigrated: z.boolean().optional(), - diffSettingsMigrated: z.boolean().optional(), openAiHeadersMigrated: z.boolean().optional(), consecutiveMistakeLimitMigrated: z.boolean().optional(), todoListEnabledMigrated: z.boolean().optional(), @@ -68,7 +67,6 @@ export class ProviderSettingsManager { modeApiConfigs: this.defaultModeApiConfigs, migrations: { rateLimitSecondsMigrated: true, // Mark as migrated on fresh installs - diffSettingsMigrated: true, // Mark as migrated on fresh installs openAiHeadersMigrated: true, // Mark as migrated on fresh installs consecutiveMistakeLimitMigrated: true, // Mark as migrated on fresh installs todoListEnabledMigrated: true, // Mark as migrated on fresh installs @@ -141,7 +139,6 @@ export class ProviderSettingsManager { if (!providerProfiles.migrations) { providerProfiles.migrations = { rateLimitSecondsMigrated: false, - diffSettingsMigrated: false, openAiHeadersMigrated: false, consecutiveMistakeLimitMigrated: false, todoListEnabledMigrated: false, @@ -156,12 +153,6 @@ export class ProviderSettingsManager { isDirty = true } - if (!providerProfiles.migrations.diffSettingsMigrated) { - await this.migrateDiffSettings(providerProfiles) - providerProfiles.migrations.diffSettingsMigrated = true - isDirty = true - } - if (!providerProfiles.migrations.openAiHeadersMigrated) { await this.migrateOpenAiHeaders(providerProfiles) providerProfiles.migrations.openAiHeadersMigrated = true @@ -234,41 +225,6 @@ export class ProviderSettingsManager { } } - private async migrateDiffSettings(providerProfiles: ProviderProfiles) { - try { - let diffEnabled: boolean | undefined - let fuzzyMatchThreshold: number | undefined - - try { - diffEnabled = await this.context.globalState.get("diffEnabled") - fuzzyMatchThreshold = await this.context.globalState.get("fuzzyMatchThreshold") - } catch (error) { - console.error("[MigrateDiffSettings] Error getting global diff settings:", error) - } - - if (diffEnabled === undefined) { - // Failed to get the existing value, use the default. - diffEnabled = true - } - - if (fuzzyMatchThreshold === undefined) { - // Failed to get the existing value, use the default. - fuzzyMatchThreshold = 1.0 - } - - for (const [_name, apiConfig] of Object.entries(providerProfiles.apiConfigs)) { - if (apiConfig.diffEnabled === undefined) { - apiConfig.diffEnabled = diffEnabled - } - if (apiConfig.fuzzyMatchThreshold === undefined) { - apiConfig.fuzzyMatchThreshold = fuzzyMatchThreshold - } - } - } catch (error) { - console.error(`[MigrateDiffSettings] Failed to migrate diff settings:`, error) - } - } - private async migrateOpenAiHeaders(providerProfiles: ProviderProfiles) { try { for (const [_name, apiConfig] of Object.entries(providerProfiles.apiConfigs)) { diff --git a/src/core/environment/__tests__/getEnvironmentDetails.spec.ts b/src/core/environment/__tests__/getEnvironmentDetails.spec.ts index 65b447ff162..eef92e9b6ff 100644 --- a/src/core/environment/__tests__/getEnvironmentDetails.spec.ts +++ b/src/core/environment/__tests__/getEnvironmentDetails.spec.ts @@ -115,7 +115,6 @@ describe("getEnvironmentDetails", () => { createMessage: vi.fn(), countTokens: vi.fn(), } as unknown as ApiHandler, - diffEnabled: true, providerRef: { deref: vi.fn().mockReturnValue(mockProvider), [Symbol.toStringTag]: "WeakRef", diff --git a/src/core/prompts/__tests__/add-custom-instructions.spec.ts b/src/core/prompts/__tests__/add-custom-instructions.spec.ts index daf4d961f1b..52b34963703 100644 --- a/src/core/prompts/__tests__/add-custom-instructions.spec.ts +++ b/src/core/prompts/__tests__/add-custom-instructions.spec.ts @@ -210,7 +210,6 @@ describe("addCustomInstructions", () => { undefined, // customModePrompts undefined, // customModes undefined, // globalCustomInstructions - undefined, // diffEnabled undefined, // experiments true, // enableMcpServerCreation undefined, // language @@ -233,7 +232,6 @@ describe("addCustomInstructions", () => { undefined, // customModePrompts undefined, // customModes undefined, // globalCustomInstructions - undefined, // diffEnabled undefined, // experiments true, // enableMcpServerCreation undefined, // language @@ -258,7 +256,6 @@ describe("addCustomInstructions", () => { undefined, // customModePrompts undefined, // customModes, undefined, // globalCustomInstructions - undefined, // diffEnabled undefined, // experiments true, // enableMcpServerCreation undefined, // language @@ -284,7 +281,6 @@ describe("addCustomInstructions", () => { undefined, // customModePrompts undefined, // customModes, undefined, // globalCustomInstructions - undefined, // diffEnabled undefined, // experiments false, // enableMcpServerCreation undefined, // language @@ -308,7 +304,6 @@ describe("addCustomInstructions", () => { undefined, // customModePrompts undefined, // customModes, undefined, // globalCustomInstructions - undefined, // diffEnabled undefined, // experiments true, // enableMcpServerCreation undefined, // language diff --git a/src/core/prompts/__tests__/custom-system-prompt.spec.ts b/src/core/prompts/__tests__/custom-system-prompt.spec.ts index 6106e161743..5399b92c651 100644 --- a/src/core/prompts/__tests__/custom-system-prompt.spec.ts +++ b/src/core/prompts/__tests__/custom-system-prompt.spec.ts @@ -104,7 +104,6 @@ describe("File-Based Custom System Prompt", () => { customModePrompts, // customModePrompts undefined, // customModes undefined, // globalCustomInstructions - undefined, // diffEnabled undefined, // experiments true, // enableMcpServerCreation undefined, // language @@ -142,7 +141,6 @@ describe("File-Based Custom System Prompt", () => { undefined, // customModePrompts undefined, // customModes undefined, // globalCustomInstructions - undefined, // diffEnabled undefined, // experiments true, // enableMcpServerCreation undefined, // language @@ -188,7 +186,6 @@ describe("File-Based Custom System Prompt", () => { customModePrompts, // customModePrompts undefined, // customModes undefined, // globalCustomInstructions - undefined, // diffEnabled undefined, // experiments true, // enableMcpServerCreation undefined, // language diff --git a/src/core/prompts/__tests__/system-prompt.spec.ts b/src/core/prompts/__tests__/system-prompt.spec.ts index a0953b2de17..046162a152e 100644 --- a/src/core/prompts/__tests__/system-prompt.spec.ts +++ b/src/core/prompts/__tests__/system-prompt.spec.ts @@ -227,7 +227,6 @@ describe("SYSTEM_PROMPT", () => { undefined, // customModePrompts undefined, // customModes undefined, // globalCustomInstructions - undefined, // diffEnabled experiments, true, // enableMcpServerCreation undefined, // language @@ -250,7 +249,6 @@ describe("SYSTEM_PROMPT", () => { undefined, // customModePrompts undefined, // customModes, undefined, // globalCustomInstructions - undefined, // diffEnabled experiments, true, // enableMcpServerCreation undefined, // language @@ -275,7 +273,6 @@ describe("SYSTEM_PROMPT", () => { undefined, // customModePrompts undefined, // customModes, undefined, // globalCustomInstructions - undefined, // diffEnabled experiments, true, // enableMcpServerCreation undefined, // language @@ -298,7 +295,6 @@ describe("SYSTEM_PROMPT", () => { undefined, // customModePrompts undefined, // customModes, undefined, // globalCustomInstructions - undefined, // diffEnabled experiments, true, // enableMcpServerCreation undefined, // language @@ -321,7 +317,6 @@ describe("SYSTEM_PROMPT", () => { undefined, // customModePrompts undefined, // customModes, undefined, // globalCustomInstructions - undefined, // diffEnabled experiments, true, // enableMcpServerCreation undefined, // language @@ -332,78 +327,6 @@ describe("SYSTEM_PROMPT", () => { expect(prompt).toMatchFileSnapshot("./__snapshots__/system-prompt/with-different-viewport-size.snap") }) - it("should include diff strategy tool description when diffEnabled is true", async () => { - const prompt = await SYSTEM_PROMPT( - mockContext, - "/test/path", - false, - undefined, // mcpHub - new MultiSearchReplaceDiffStrategy(), // Use actual diff strategy from the codebase - undefined, // browserViewportSize - defaultModeSlug, // mode - undefined, // customModePrompts - undefined, // customModes - undefined, // globalCustomInstructions - true, // diffEnabled - experiments, - true, // enableMcpServerCreation - undefined, // language - undefined, // rooIgnoreInstructions - undefined, // partialReadsEnabled - ) - - expect(prompt).toContain("apply_diff") - expect(prompt).toMatchFileSnapshot("./__snapshots__/system-prompt/with-diff-enabled-true.snap") - }) - - it("should exclude diff strategy tool description when diffEnabled is false", async () => { - const prompt = await SYSTEM_PROMPT( - mockContext, - "/test/path", - false, // supportsImages - undefined, // mcpHub - new MultiSearchReplaceDiffStrategy(), // Use actual diff strategy from the codebase - undefined, // browserViewportSize - defaultModeSlug, // mode - undefined, // customModePrompts - undefined, // customModes - undefined, // globalCustomInstructions - false, // diffEnabled - experiments, - true, // enableMcpServerCreation - undefined, // language - undefined, // rooIgnoreInstructions - undefined, // partialReadsEnabled - ) - - expect(prompt).not.toContain("apply_diff") - expect(prompt).toMatchFileSnapshot("./__snapshots__/system-prompt/with-diff-enabled-false.snap") - }) - - it("should exclude diff strategy tool description when diffEnabled is undefined", async () => { - const prompt = await SYSTEM_PROMPT( - mockContext, - "/test/path", - false, - undefined, // mcpHub - new MultiSearchReplaceDiffStrategy(), // Use actual diff strategy from the codebase - undefined, // browserViewportSize - defaultModeSlug, // mode - undefined, // customModePrompts - undefined, // customModes - undefined, // globalCustomInstructions - undefined, // diffEnabled - experiments, - true, // enableMcpServerCreation - undefined, // language - undefined, // rooIgnoreInstructions - undefined, // partialReadsEnabled - ) - - expect(prompt).not.toContain("apply_diff") - expect(prompt).toMatchFileSnapshot("./__snapshots__/system-prompt/with-diff-enabled-undefined.snap") - }) - it("should include vscode language in custom instructions", async () => { // Mock vscode.env.language const vscode = vi.mocked(await import("vscode")) as any @@ -443,7 +366,6 @@ describe("SYSTEM_PROMPT", () => { undefined, // customModePrompts undefined, // customModes undefined, // globalCustomInstructions - undefined, // diffEnabled undefined, // experiments true, // enableMcpServerCreation undefined, // language @@ -504,7 +426,6 @@ describe("SYSTEM_PROMPT", () => { undefined, // customModePrompts customModes, // customModes "Global instructions", // globalCustomInstructions - undefined, // diffEnabled experiments, true, // enableMcpServerCreation undefined, // language @@ -542,7 +463,6 @@ describe("SYSTEM_PROMPT", () => { customModePrompts, // customModePrompts undefined, // customModes undefined, // globalCustomInstructions - undefined, // diffEnabled undefined, // experiments false, // enableMcpServerCreation undefined, // language @@ -575,7 +495,6 @@ describe("SYSTEM_PROMPT", () => { customModePrompts, // customModePrompts undefined, // customModes undefined, // globalCustomInstructions - undefined, // diffEnabled undefined, // experiments false, // enableMcpServerCreation undefined, // language @@ -607,7 +526,6 @@ describe("SYSTEM_PROMPT", () => { undefined, // customModePrompts undefined, // customModes undefined, // globalCustomInstructions - undefined, // diffEnabled experiments, true, // enableMcpServerCreation undefined, // language @@ -641,7 +559,6 @@ describe("SYSTEM_PROMPT", () => { undefined, // customModePrompts undefined, // customModes undefined, // globalCustomInstructions - undefined, // diffEnabled experiments, true, // enableMcpServerCreation undefined, // language @@ -674,7 +591,6 @@ describe("SYSTEM_PROMPT", () => { undefined, // customModePrompts undefined, // customModes undefined, // globalCustomInstructions - undefined, // diffEnabled experiments, true, // enableMcpServerCreation undefined, // language @@ -707,7 +623,6 @@ describe("SYSTEM_PROMPT", () => { undefined, // customModePrompts undefined, // customModes undefined, // globalCustomInstructions - undefined, // diffEnabled experiments, true, // enableMcpServerCreation undefined, // language @@ -741,7 +656,6 @@ describe("SYSTEM_PROMPT", () => { undefined, undefined, undefined, - undefined, experiments, true, undefined, @@ -779,7 +693,6 @@ describe("SYSTEM_PROMPT", () => { undefined, // customModePrompts undefined, // customModes undefined, // globalCustomInstructions - undefined, // diffEnabled experiments, true, // enableMcpServerCreation undefined, // language @@ -841,7 +754,6 @@ describe("SYSTEM_PROMPT", () => { undefined, // customModePrompts undefined, // customModes undefined, // globalCustomInstructions - undefined, // diffEnabled experiments, true, // enableMcpServerCreation undefined, // language diff --git a/src/core/prompts/system.ts b/src/core/prompts/system.ts index b6543950378..6b2d7fc5b6d 100644 --- a/src/core/prompts/system.ts +++ b/src/core/prompts/system.ts @@ -60,7 +60,6 @@ async function generatePrompt( promptComponent?: PromptComponent, customModeConfigs?: ModeConfig[], globalCustomInstructions?: string, - diffEnabled?: boolean, experiments?: Record, enableMcpServerCreation?: boolean, language?: string, @@ -74,9 +73,6 @@ async function generatePrompt( throw new Error("Extension context is required for generating system prompt") } - // If diff is disabled, don't pass the diffStrategy - const effectiveDiffStrategy = diffEnabled ? diffStrategy : undefined - // Get the full mode config to ensure we have the role definition (used for groups, etc.) const modeConfig = getModeBySlug(mode, customModeConfigs) || modes.find((m) => m.slug === mode) || modes[0] const { roleDefinition, baseInstructions } = getModeSelection(mode, promptComponent, customModeConfigs) @@ -94,12 +90,7 @@ async function generatePrompt( const [modesSection, mcpServersSection] = await Promise.all([ getModesSection(context), shouldIncludeMcp - ? getMcpServersSection( - mcpHub, - effectiveDiffStrategy, - enableMcpServerCreation, - !isNativeProtocol(effectiveProtocol), - ) + ? getMcpServersSection(mcpHub, diffStrategy, enableMcpServerCreation, !isNativeProtocol(effectiveProtocol)) : Promise.resolve(""), ]) @@ -111,7 +102,7 @@ async function generatePrompt( cwd, supportsComputerUse, codeIndexManager, - effectiveDiffStrategy, + diffStrategy, browserViewportSize, shouldIncludeMcp ? mcpHub : undefined, customModeConfigs, @@ -174,7 +165,6 @@ export const SYSTEM_PROMPT = async ( customModePrompts?: CustomModePrompts, customModes?: ModeConfig[], globalCustomInstructions?: string, - diffEnabled?: boolean, experiments?: Record, enableMcpServerCreation?: boolean, language?: string, @@ -232,21 +222,17 @@ ${fileCustomSystemPrompt} ${customInstructions}` } - // If diff is disabled, don't pass the diffStrategy - const effectiveDiffStrategy = diffEnabled ? diffStrategy : undefined - return generatePrompt( context, cwd, supportsComputerUse, currentMode.slug, mcpHub, - effectiveDiffStrategy, + diffStrategy, browserViewportSize, promptComponent, customModes, globalCustomInstructions, - diffEnabled, experiments, enableMcpServerCreation, language, diff --git a/src/core/prompts/tools/filter-tools-for-mode.ts b/src/core/prompts/tools/filter-tools-for-mode.ts index f296c1b5c50..7f5a827dbd6 100644 --- a/src/core/prompts/tools/filter-tools-for-mode.ts +++ b/src/core/prompts/tools/filter-tools-for-mode.ts @@ -296,11 +296,6 @@ export function filterNativeToolsForMode( allowedToolNames.delete("browser_action") } - // Conditionally exclude apply_diff if diffs are disabled - if (settings?.diffEnabled === false) { - allowedToolNames.delete("apply_diff") - } - // Conditionally exclude access_mcp_resource if MCP is not enabled or there are no resources if (!mcpHub || !hasAnyMcpResources(mcpHub)) { allowedToolNames.delete("access_mcp_resource") diff --git a/src/core/task/Task.ts b/src/core/task/Task.ts index 92ea6aa957e..4d57ae3f200 100644 --- a/src/core/task/Task.ts +++ b/src/core/task/Task.ts @@ -141,11 +141,9 @@ const MAX_CONTEXT_WINDOW_RETRIES = 3 // Maximum retries for context window error export interface TaskOptions extends CreateTaskOptions { provider: ClineProvider apiConfiguration: ProviderSettings - enableDiff?: boolean enableCheckpoints?: boolean checkpointTimeout?: number enableBridge?: boolean - fuzzyMatchThreshold?: number consecutiveMistakeLimit?: number task?: string images?: string[] @@ -291,8 +289,6 @@ export class Task extends EventEmitter implements TaskLike { // Editing diffViewProvider: DiffViewProvider diffStrategy?: DiffStrategy - diffEnabled: boolean = false - fuzzyMatchThreshold: number didEditFile: boolean = false // LLM Messages & Chat Messages @@ -373,11 +369,9 @@ export class Task extends EventEmitter implements TaskLike { constructor({ provider, apiConfiguration, - enableDiff = false, enableCheckpoints = true, checkpointTimeout = DEFAULT_CHECKPOINT_TIMEOUT_SECONDS, enableBridge = false, - fuzzyMatchThreshold = 1.0, consecutiveMistakeLimit = DEFAULT_CONSECUTIVE_MISTAKE_LIMIT, task, images, @@ -465,8 +459,6 @@ export class Task extends EventEmitter implements TaskLike { } } }) - this.diffEnabled = enableDiff - this.fuzzyMatchThreshold = fuzzyMatchThreshold this.consecutiveMistakeLimit = consecutiveMistakeLimit ?? DEFAULT_CONSECUTIVE_MISTAKE_LIMIT this.providerRef = new WeakRef(provider) this.globalStoragePath = provider.context.globalStorageUri.fsPath @@ -522,23 +514,20 @@ export class Task extends EventEmitter implements TaskLike { // Listen for provider profile changes to update parser state this.setupProviderProfileChangeListener(provider) - // Only set up diff strategy if diff is enabled. - if (this.diffEnabled) { - // Default to old strategy, will be updated if experiment is enabled. - this.diffStrategy = new MultiSearchReplaceDiffStrategy(this.fuzzyMatchThreshold) + // Always set up diff strategy - default to old strategy, will be updated if experiment is enabled. + this.diffStrategy = new MultiSearchReplaceDiffStrategy() - // Check experiment asynchronously and update strategy if needed. - provider.getState().then((state) => { - const isMultiFileApplyDiffEnabled = experiments.isEnabled( - state.experiments ?? {}, - EXPERIMENT_IDS.MULTI_FILE_APPLY_DIFF, - ) + // Check experiment asynchronously and update strategy if needed. + provider.getState().then((state) => { + const isMultiFileApplyDiffEnabled = experiments.isEnabled( + state.experiments ?? {}, + EXPERIMENT_IDS.MULTI_FILE_APPLY_DIFF, + ) - if (isMultiFileApplyDiffEnabled) { - this.diffStrategy = new MultiFileSearchReplaceDiffStrategy(this.fuzzyMatchThreshold) - } - }) - } + if (isMultiFileApplyDiffEnabled) { + this.diffStrategy = new MultiFileSearchReplaceDiffStrategy() + } + }) this.toolRepetitionDetector = new ToolRepetitionDetector(this.consecutiveMistakeLimit) @@ -3475,7 +3464,6 @@ export class Task extends EventEmitter implements TaskLike { customModePrompts, customModes, customInstructions, - this.diffEnabled, experiments, enableMcpServerCreation, language, @@ -3828,7 +3816,6 @@ export class Task extends EventEmitter implements TaskLike { maxReadFileLine: state?.maxReadFileLine ?? -1, browserToolEnabled: state?.browserToolEnabled ?? true, modelInfo, - diffEnabled: this.diffEnabled, }) } diff --git a/src/core/task/__tests__/Task.spec.ts b/src/core/task/__tests__/Task.spec.ts index 7b2d0f3a36c..5443996e0e6 100644 --- a/src/core/task/__tests__/Task.spec.ts +++ b/src/core/task/__tests__/Task.spec.ts @@ -304,31 +304,15 @@ describe("Cline", () => { }) describe("constructor", () => { - it("should respect provided settings", async () => { + it("should always have diff strategy defined", async () => { const cline = new Task({ provider: mockProvider, apiConfiguration: mockApiConfig, - fuzzyMatchThreshold: 0.95, task: "test task", startTask: false, }) - expect(cline.diffEnabled).toBe(false) - }) - - it("should use default fuzzy match threshold when not provided", async () => { - const cline = new Task({ - provider: mockProvider, - apiConfiguration: mockApiConfig, - enableDiff: true, - fuzzyMatchThreshold: 0.95, - task: "test task", - startTask: false, - }) - - expect(cline.diffEnabled).toBe(true) - - // The diff strategy should be created with default threshold (1.0). + // Diff is always enabled - diffStrategy should be defined expect(cline.diffStrategy).toBeDefined() }) @@ -1387,19 +1371,6 @@ describe("Cline", () => { expect(task.diffStrategy).toBeInstanceOf(MultiSearchReplaceDiffStrategy) expect(task.diffStrategy?.getName()).toBe("MultiSearchReplace") }) - - it("should not create diff strategy when enableDiff is false", async () => { - const task = new Task({ - provider: mockProvider, - apiConfiguration: mockApiConfig, - enableDiff: false, - task: "test task", - startTask: false, - }) - - expect(task.diffEnabled).toBe(false) - expect(task.diffStrategy).toBeUndefined() - }) }) describe("getApiProtocol", () => { diff --git a/src/core/task/build-tools.ts b/src/core/task/build-tools.ts index 8eea4ace82c..9dde98335ae 100644 --- a/src/core/task/build-tools.ts +++ b/src/core/task/build-tools.ts @@ -21,7 +21,6 @@ interface BuildToolsOptions { maxReadFileLine: number browserToolEnabled: boolean modelInfo?: ModelInfo - diffEnabled: boolean } /** @@ -42,7 +41,6 @@ export async function buildNativeToolsArray(options: BuildToolsOptions): Promise maxReadFileLine, browserToolEnabled, modelInfo, - diffEnabled, } = options const mcpHub = provider.getMcpHub() @@ -56,7 +54,6 @@ export async function buildNativeToolsArray(options: BuildToolsOptions): Promise todoListEnabled: apiConfiguration?.todoListEnabled ?? true, browserToolEnabled: browserToolEnabled ?? true, modelInfo, - diffEnabled, } // Determine if partial reads are enabled based on maxReadFileLine setting. diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 5cf6c6611b9..d0c83545a3a 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -906,24 +906,14 @@ export class ClineProvider } } - const { - apiConfiguration, - diffEnabled: enableDiff, - enableCheckpoints, - checkpointTimeout, - fuzzyMatchThreshold, - experiments, - cloudUserInfo, - taskSyncEnabled, - } = await this.getState() + const { apiConfiguration, enableCheckpoints, checkpointTimeout, experiments, cloudUserInfo, taskSyncEnabled } = + await this.getState() const task = new Task({ provider: this, apiConfiguration, - enableDiff, enableCheckpoints, checkpointTimeout, - fuzzyMatchThreshold, consecutiveMistakeLimit: apiConfiguration.consecutiveMistakeLimit, historyItem, experiments, @@ -1824,7 +1814,6 @@ export class ClineProvider soundEnabled, ttsEnabled, ttsSpeed, - diffEnabled, enableCheckpoints, checkpointTimeout, taskHistory, @@ -1845,7 +1834,6 @@ export class ClineProvider terminalZshOhMy, terminalZshP10k, terminalZdotdir, - fuzzyMatchThreshold, mcpEnabled, enableMcpServerCreation, currentApiConfigName, @@ -1965,7 +1953,6 @@ export class ClineProvider soundEnabled: soundEnabled ?? false, ttsEnabled: ttsEnabled ?? false, ttsSpeed: ttsSpeed ?? 1.0, - diffEnabled: diffEnabled ?? true, enableCheckpoints: enableCheckpoints ?? true, checkpointTimeout: checkpointTimeout ?? DEFAULT_CHECKPOINT_TIMEOUT_SECONDS, shouldShowAnnouncement: @@ -1989,7 +1976,6 @@ export class ClineProvider terminalZshOhMy: terminalZshOhMy ?? false, terminalZshP10k: terminalZshP10k ?? false, terminalZdotdir: terminalZdotdir ?? false, - fuzzyMatchThreshold: fuzzyMatchThreshold ?? 1.0, mcpEnabled: mcpEnabled ?? true, enableMcpServerCreation: enableMcpServerCreation ?? true, currentApiConfigName: currentApiConfigName ?? "default", @@ -2217,7 +2203,6 @@ export class ClineProvider soundEnabled: stateValues.soundEnabled ?? false, ttsEnabled: stateValues.ttsEnabled ?? false, ttsSpeed: stateValues.ttsSpeed ?? 1.0, - diffEnabled: stateValues.diffEnabled ?? true, enableCheckpoints: stateValues.enableCheckpoints ?? true, checkpointTimeout: stateValues.checkpointTimeout ?? DEFAULT_CHECKPOINT_TIMEOUT_SECONDS, soundVolume: stateValues.soundVolume, @@ -2226,7 +2211,6 @@ export class ClineProvider remoteBrowserHost: stateValues.remoteBrowserHost, remoteBrowserEnabled: stateValues.remoteBrowserEnabled ?? false, cachedChromeHostUrl: stateValues.cachedChromeHostUrl as string | undefined, - fuzzyMatchThreshold: stateValues.fuzzyMatchThreshold ?? 1.0, writeDelayMs: stateValues.writeDelayMs ?? DEFAULT_WRITE_DELAY_MS, terminalOutputLineLimit: stateValues.terminalOutputLineLimit ?? 500, terminalOutputCharacterLimit: @@ -2676,10 +2660,8 @@ export class ClineProvider const { apiConfiguration, organizationAllowList, - diffEnabled: enableDiff, enableCheckpoints, checkpointTimeout, - fuzzyMatchThreshold, experiments, cloudUserInfo, remoteControlEnabled, @@ -2701,10 +2683,8 @@ export class ClineProvider const task = new Task({ provider: this, apiConfiguration, - enableDiff, enableCheckpoints, checkpointTimeout, - fuzzyMatchThreshold, consecutiveMistakeLimit: apiConfiguration.consecutiveMistakeLimit, task: text, images, diff --git a/src/core/webview/__tests__/ClineProvider.spec.ts b/src/core/webview/__tests__/ClineProvider.spec.ts index 9eb01406ff5..dc7ce13abf0 100644 --- a/src/core/webview/__tests__/ClineProvider.spec.ts +++ b/src/core/webview/__tests__/ClineProvider.spec.ts @@ -553,11 +553,9 @@ describe("ClineProvider", () => { uriScheme: "vscode", soundEnabled: false, ttsEnabled: false, - diffEnabled: false, enableCheckpoints: false, writeDelayMs: 1000, browserViewportSize: "900x600", - fuzzyMatchThreshold: 1.0, mcpEnabled: true, enableMcpServerCreation: false, mode: defaultModeSlug, @@ -765,7 +763,6 @@ describe("ClineProvider", () => { expect(state).toHaveProperty("taskHistory") expect(state).toHaveProperty("soundEnabled") expect(state).toHaveProperty("ttsEnabled") - expect(state).toHaveProperty("diffEnabled") expect(state).toHaveProperty("writeDelayMs") }) @@ -777,15 +774,6 @@ describe("ClineProvider", () => { expect(state.language).toBe("pt-BR") }) - test("diffEnabled defaults to true when not set", async () => { - // Mock globalState.get to return undefined for diffEnabled - ;(mockContext.globalState.get as any).mockReturnValue(undefined) - - const state = await provider.getState() - - expect(state.diffEnabled).toBe(true) - }) - test("writeDelayMs defaults to 1000ms", async () => { // Mock globalState.get to return undefined for writeDelayMs ;(mockContext.globalState.get as any).mockImplementation((key: string) => @@ -1441,10 +1429,10 @@ describe("ClineProvider", () => { ) }) - test("generates system prompt with diff enabled", async () => { + test("generates system prompt with various configurations", async () => { await provider.resolveWebviewView(mockWebviewView) - // Mock getState to return diffEnabled: true + // Mock getState with typical configuration vi.spyOn(provider, "getState").mockResolvedValue({ apiConfiguration: { apiProvider: "openrouter", @@ -1455,8 +1443,6 @@ describe("ClineProvider", () => { enableMcpServerCreation: true, mcpEnabled: false, browserViewportSize: "900x600", - diffEnabled: true, - fuzzyMatchThreshold: 0.8, experiments: experimentDefault, browserToolEnabled: true, } as any) @@ -1475,40 +1461,6 @@ describe("ClineProvider", () => { ) }) - test("generates system prompt with diff disabled", async () => { - await provider.resolveWebviewView(mockWebviewView) - - // Mock getState to return diffEnabled: false - vi.spyOn(provider, "getState").mockResolvedValue({ - apiConfiguration: { - apiProvider: "openrouter", - apiModelId: "test-model", - }, - customModePrompts: {}, - mode: "code", - mcpEnabled: false, - browserViewportSize: "900x600", - diffEnabled: false, - fuzzyMatchThreshold: 0.8, - experiments: experimentDefault, - enableMcpServerCreation: true, - browserToolEnabled: false, - } as any) - - // Trigger getSystemPrompt - const handler = getMessageHandler() - await handler({ type: "getSystemPrompt", mode: "code" }) - - // Verify system prompt was generated and sent - expect(mockPostMessage).toHaveBeenCalledWith( - expect.objectContaining({ - type: "systemPrompt", - text: expect.any(String), - mode: "code", - }), - ) - }) - test("uses correct mode-specific instructions when mode is specified", async () => { await provider.resolveWebviewView(mockWebviewView) diff --git a/src/core/webview/generateSystemPrompt.ts b/src/core/webview/generateSystemPrompt.ts index e79aa707282..bc5895d0575 100644 --- a/src/core/webview/generateSystemPrompt.ts +++ b/src/core/webview/generateSystemPrompt.ts @@ -18,9 +18,7 @@ export const generateSystemPrompt = async (provider: ClineProvider, message: Web customModePrompts, customInstructions, browserViewportSize, - diffEnabled, mcpEnabled, - fuzzyMatchThreshold, experiments, enableMcpServerCreation, browserToolEnabled, @@ -36,8 +34,8 @@ export const generateSystemPrompt = async (provider: ClineProvider, message: Web ) const diffStrategy = isMultiFileApplyDiffEnabled - ? new MultiFileSearchReplaceDiffStrategy(fuzzyMatchThreshold) - : new MultiSearchReplaceDiffStrategy(fuzzyMatchThreshold) + ? new MultiFileSearchReplaceDiffStrategy() + : new MultiSearchReplaceDiffStrategy() const cwd = provider.cwd @@ -83,7 +81,6 @@ export const generateSystemPrompt = async (provider: ClineProvider, message: Web customModePrompts, customModes, customInstructions, - diffEnabled, experiments, enableMcpServerCreation, language, diff --git a/src/shared/ExtensionMessage.ts b/src/shared/ExtensionMessage.ts index 093485fa3ee..43acf535c7a 100644 --- a/src/shared/ExtensionMessage.ts +++ b/src/shared/ExtensionMessage.ts @@ -270,8 +270,6 @@ export type ExtensionState = Pick< | "terminalZdotdir" | "terminalCompressProgressBar" | "diagnosticsEnabled" - | "diffEnabled" - | "fuzzyMatchThreshold" | "language" | "modeApiConfigs" | "customModePrompts" @@ -322,7 +320,7 @@ export type ExtensionState = Pick< mode: Mode customModes: ModeConfig[] - toolRequirements?: Record // Map of tool names to their requirements (e.g. {"apply_diff": true} if diffEnabled) + toolRequirements?: Record // Map of tool names to their requirements cwd?: string // Current working directory telemetrySetting: TelemetrySetting diff --git a/webview-ui/src/components/settings/ApiOptions.tsx b/webview-ui/src/components/settings/ApiOptions.tsx index 00092fea9d1..343ca466f17 100644 --- a/webview-ui/src/components/settings/ApiOptions.tsx +++ b/webview-ui/src/components/settings/ApiOptions.tsx @@ -106,7 +106,6 @@ import { ModelInfoView } from "./ModelInfoView" import { ApiErrorMessage } from "./ApiErrorMessage" import { ThinkingBudget } from "./ThinkingBudget" import { Verbosity } from "./Verbosity" -import { DiffSettingsControl } from "./DiffSettingsControl" import { TodoListSettingsControl } from "./TodoListSettingsControl" import { TemperatureControl } from "./TemperatureControl" import { RateLimitSecondsControl } from "./RateLimitSecondsControl" @@ -858,11 +857,6 @@ const ApiOptions = ({ todoListEnabled={apiConfiguration.todoListEnabled} onChange={(field, value) => setApiConfigurationField(field, value)} /> - setApiConfigurationField(field, value)} - /> {selectedModelInfo?.supportsTemperature !== false && ( void -} - -export const DiffSettingsControl: React.FC = ({ - diffEnabled = true, - fuzzyMatchThreshold = 1.0, - onChange, -}) => { - const { t } = useAppTranslation() - - const handleDiffEnabledChange = useCallback( - (e: any) => { - onChange("diffEnabled", e.target.checked) - }, - [onChange], - ) - - const handleThresholdChange = useCallback( - (newValue: number[]) => { - onChange("fuzzyMatchThreshold", newValue[0]) - }, - [onChange], - ) - - return ( -
-
- - {t("settings:advanced.diff.label")} - -
- {t("settings:advanced.diff.description")} -
-
- - {diffEnabled && ( -
-
- -
- - {Math.round(fuzzyMatchThreshold * 100)}% -
-
- {t("settings:advanced.diff.matchPrecision.description")} -
-
-
- )} -
- ) -} diff --git a/webview-ui/src/components/settings/SettingsView.tsx b/webview-ui/src/components/settings/SettingsView.tsx index f5676ff9a88..2bed6697b63 100644 --- a/webview-ui/src/components/settings/SettingsView.tsx +++ b/webview-ui/src/components/settings/SettingsView.tsx @@ -163,9 +163,7 @@ const SettingsView = forwardRef(({ onDone, t browserViewportSize, enableCheckpoints, checkpointTimeout, - diffEnabled, experiments, - fuzzyMatchThreshold, maxOpenTabsContext, maxWorkspaceFiles, mcpEnabled, @@ -371,13 +369,11 @@ const SettingsView = forwardRef(({ onDone, t soundVolume: soundVolume ?? 0.5, ttsEnabled, ttsSpeed, - diffEnabled: diffEnabled ?? true, enableCheckpoints: enableCheckpoints ?? false, checkpointTimeout: checkpointTimeout ?? DEFAULT_CHECKPOINT_TIMEOUT_SECONDS, browserViewportSize: browserViewportSize ?? "900x600", remoteBrowserHost: remoteBrowserEnabled ? remoteBrowserHost : undefined, remoteBrowserEnabled: remoteBrowserEnabled ?? false, - fuzzyMatchThreshold: fuzzyMatchThreshold ?? 1.0, writeDelayMs, screenshotQuality: screenshotQuality ?? 75, terminalOutputLineLimit: terminalOutputLineLimit ?? 500, diff --git a/webview-ui/src/components/settings/__tests__/ApiOptions.spec.tsx b/webview-ui/src/components/settings/__tests__/ApiOptions.spec.tsx index a28926742fd..473b2eebe1c 100644 --- a/webview-ui/src/components/settings/__tests__/ApiOptions.spec.tsx +++ b/webview-ui/src/components/settings/__tests__/ApiOptions.spec.tsx @@ -157,33 +157,6 @@ vi.mock("../RateLimitSecondsControl", () => ({ ), })) -// Mock DiffSettingsControl for tests -vi.mock("../DiffSettingsControl", () => ({ - DiffSettingsControl: ({ diffEnabled, fuzzyMatchThreshold, onChange }: any) => ( -
- -
- Fuzzy match threshold - onChange("fuzzyMatchThreshold", parseFloat(e.target.value))} - min={0.8} - max={1} - step={0.005} - /> -
-
- ), -})) - // Mock TodoListSettingsControl for tests vi.mock("../TodoListSettingsControl", () => ({ TodoListSettingsControl: ({ todoListEnabled, onChange }: any) => ( @@ -297,23 +270,16 @@ const renderApiOptions = (props: Partial = {}) => { } describe("ApiOptions", () => { - it("shows diff settings, temperature and rate limit controls by default", () => { + it("shows temperature and rate limit controls by default", () => { renderApiOptions({ - apiConfiguration: { - diffEnabled: true, - fuzzyMatchThreshold: 0.95, - }, + apiConfiguration: {}, }) - // Check for DiffSettingsControl by looking for text content - expect(screen.getByText(/enable editing through diffs/i)).toBeInTheDocument() expect(screen.getByTestId("temperature-control")).toBeInTheDocument() expect(screen.getByTestId("rate-limit-seconds-control")).toBeInTheDocument() }) it("hides all controls when fromWelcomeView is true", () => { renderApiOptions({ fromWelcomeView: true }) - // Check for absence of DiffSettingsControl text - expect(screen.queryByText(/enable editing through diffs/i)).not.toBeInTheDocument() expect(screen.queryByTestId("temperature-control")).not.toBeInTheDocument() expect(screen.queryByTestId("rate-limit-seconds-control")).not.toBeInTheDocument() }) diff --git a/webview-ui/src/context/ExtensionStateContext.tsx b/webview-ui/src/context/ExtensionStateContext.tsx index 08294f9fe8e..aaa04afd8f3 100644 --- a/webview-ui/src/context/ExtensionStateContext.tsx +++ b/webview-ui/src/context/ExtensionStateContext.tsx @@ -88,12 +88,10 @@ export interface ExtensionStateContextType extends ExtensionState { setTerminalZdotdir: (value: boolean) => void setTtsEnabled: (value: boolean) => void setTtsSpeed: (value: number) => void - setDiffEnabled: (value: boolean) => void setEnableCheckpoints: (value: boolean) => void checkpointTimeout: number setCheckpointTimeout: (value: number) => void setBrowserViewportSize: (value: string) => void - setFuzzyMatchThreshold: (value: number) => void setWriteDelayMs: (value: number) => void screenshotQuality?: number setScreenshotQuality: (value: number) => void @@ -200,10 +198,8 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode isBrowserSessionActive: false, ttsEnabled: false, ttsSpeed: 1.0, - diffEnabled: false, enableCheckpoints: true, checkpointTimeout: DEFAULT_CHECKPOINT_TIMEOUT_SECONDS, // Default to 15 seconds - fuzzyMatchThreshold: 1.0, language: "en", // Default language code writeDelayMs: 1000, browserViewportSize: "900x600", @@ -458,7 +454,6 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode commands, soundVolume: state.soundVolume, ttsSpeed: state.ttsSpeed, - fuzzyMatchThreshold: state.fuzzyMatchThreshold, writeDelayMs: state.writeDelayMs, screenshotQuality: state.screenshotQuality, routerModels: extensionRouterModels, @@ -500,12 +495,10 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode setSoundVolume: (value) => setState((prevState) => ({ ...prevState, soundVolume: value })), setTtsEnabled: (value) => setState((prevState) => ({ ...prevState, ttsEnabled: value })), setTtsSpeed: (value) => setState((prevState) => ({ ...prevState, ttsSpeed: value })), - setDiffEnabled: (value) => setState((prevState) => ({ ...prevState, diffEnabled: value })), setEnableCheckpoints: (value) => setState((prevState) => ({ ...prevState, enableCheckpoints: value })), setCheckpointTimeout: (value) => setState((prevState) => ({ ...prevState, checkpointTimeout: value })), setBrowserViewportSize: (value: string) => setState((prevState) => ({ ...prevState, browserViewportSize: value })), - setFuzzyMatchThreshold: (value) => setState((prevState) => ({ ...prevState, fuzzyMatchThreshold: value })), setWriteDelayMs: (value) => setState((prevState) => ({ ...prevState, writeDelayMs: value })), setScreenshotQuality: (value) => setState((prevState) => ({ ...prevState, screenshotQuality: value })), setTerminalOutputLineLimit: (value) => diff --git a/webview-ui/src/i18n/locales/ca/settings.json b/webview-ui/src/i18n/locales/ca/settings.json index c64dccde8f1..5b197060767 100644 --- a/webview-ui/src/i18n/locales/ca/settings.json +++ b/webview-ui/src/i18n/locales/ca/settings.json @@ -752,10 +752,6 @@ "unified": "L'estratègia de diff unificat pren múltiples enfocaments per aplicar diffs i tria el millor enfocament.", "multiBlock": "L'estratègia de diff multi-bloc permet actualitzar múltiples blocs de codi en un fitxer en una sola sol·licitud." } - }, - "matchPrecision": { - "label": "Precisió de coincidència", - "description": "Aquest control lliscant controla amb quina precisió han de coincidir les seccions de codi en aplicar diffs. Valors més baixos permeten coincidències més flexibles però augmenten el risc de reemplaçaments incorrectes. Utilitzeu valors per sota del 100% amb extrema precaució." } }, "todoList": { diff --git a/webview-ui/src/i18n/locales/de/settings.json b/webview-ui/src/i18n/locales/de/settings.json index ced4a8b428e..b3b6354fd1a 100644 --- a/webview-ui/src/i18n/locales/de/settings.json +++ b/webview-ui/src/i18n/locales/de/settings.json @@ -752,10 +752,6 @@ "unified": "Die einheitliche Diff-Strategie wendet mehrere Ansätze zur Anwendung von Diffs an und wählt den besten Ansatz.", "multiBlock": "Die Mehrblock-Diff-Strategie ermöglicht das Aktualisieren mehrerer Codeblöcke in einer Datei in einer Anfrage." } - }, - "matchPrecision": { - "label": "Übereinstimmungspräzision", - "description": "Dieser Schieberegler steuert, wie genau Codeabschnitte bei der Anwendung von Diffs übereinstimmen müssen. Niedrigere Werte ermöglichen eine flexiblere Übereinstimmung, erhöhen aber das Risiko falscher Ersetzungen. Verwenden Sie Werte unter 100 % mit äußerster Vorsicht." } }, "todoList": { diff --git a/webview-ui/src/i18n/locales/en/settings.json b/webview-ui/src/i18n/locales/en/settings.json index a4aeea1ae63..12dfc20895e 100644 --- a/webview-ui/src/i18n/locales/en/settings.json +++ b/webview-ui/src/i18n/locales/en/settings.json @@ -761,10 +761,6 @@ "unified": "Unified diff strategy takes multiple approaches to applying diffs and chooses the best approach.", "multiBlock": "Multi-block diff strategy allows updating multiple code blocks in a file in one request." } - }, - "matchPrecision": { - "label": "Match precision", - "description": "This slider controls how precisely code sections must match when applying diffs. Lower values allow more flexible matching but increase the risk of incorrect replacements. Use values below 100% with extreme caution." } }, "todoList": { diff --git a/webview-ui/src/i18n/locales/es/settings.json b/webview-ui/src/i18n/locales/es/settings.json index e0e1881d177..764f532f023 100644 --- a/webview-ui/src/i18n/locales/es/settings.json +++ b/webview-ui/src/i18n/locales/es/settings.json @@ -752,10 +752,6 @@ "unified": "La estrategia de diff unificado toma múltiples enfoques para aplicar diffs y elige el mejor enfoque.", "multiBlock": "La estrategia de diff multi-bloque permite actualizar múltiples bloques de código en un archivo en una sola solicitud." } - }, - "matchPrecision": { - "label": "Precisión de coincidencia", - "description": "Este control deslizante controla cuán precisamente deben coincidir las secciones de código al aplicar diffs. Valores más bajos permiten coincidencias más flexibles pero aumentan el riesgo de reemplazos incorrectos. Use valores por debajo del 100% con extrema precaución." } }, "todoList": { diff --git a/webview-ui/src/i18n/locales/fr/settings.json b/webview-ui/src/i18n/locales/fr/settings.json index 6ff29c77a45..1803164521f 100644 --- a/webview-ui/src/i18n/locales/fr/settings.json +++ b/webview-ui/src/i18n/locales/fr/settings.json @@ -752,10 +752,6 @@ "unified": "La stratégie de diff unifié prend plusieurs approches pour appliquer les diffs et choisit la meilleure approche.", "multiBlock": "La stratégie de diff multi-blocs permet de mettre à jour plusieurs blocs de code dans un fichier en une seule requête." } - }, - "matchPrecision": { - "label": "Précision de correspondance", - "description": "Ce curseur contrôle la précision avec laquelle les sections de code doivent correspondre lors de l'application des diffs. Des valeurs plus basses permettent des correspondances plus flexibles mais augmentent le risque de remplacements incorrects. Utilisez des valeurs inférieures à 100 % avec une extrême prudence." } }, "todoList": { diff --git a/webview-ui/src/i18n/locales/hi/settings.json b/webview-ui/src/i18n/locales/hi/settings.json index 06efbf63243..97c9fe3e212 100644 --- a/webview-ui/src/i18n/locales/hi/settings.json +++ b/webview-ui/src/i18n/locales/hi/settings.json @@ -753,10 +753,6 @@ "unified": "एकीकृत diff रणनीति diffs लागू करने के लिए कई दृष्टिकोण लेती है और सर्वोत्तम दृष्टिकोण चुनती है।", "multiBlock": "मल्टी-ब्लॉक diff रणनीति एक अनुरोध में एक फाइल में कई कोड ब्लॉक अपडेट करने की अनुमति देती है।" } - }, - "matchPrecision": { - "label": "मिलान सटीकता", - "description": "यह स्लाइडर नियंत्रित करता है कि diffs लागू करते समय कोड अनुभागों को कितनी सटीकता से मेल खाना चाहिए। निम्न मान अधिक लचीले मिलान की अनुमति देते हैं लेकिन गलत प्रतिस्थापन का जोखिम बढ़ाते हैं। 100% से नीचे के मानों का उपयोग अत्यधिक सावधानी के साथ करें।" } }, "todoList": { diff --git a/webview-ui/src/i18n/locales/id/settings.json b/webview-ui/src/i18n/locales/id/settings.json index 6cae436f089..d99974236af 100644 --- a/webview-ui/src/i18n/locales/id/settings.json +++ b/webview-ui/src/i18n/locales/id/settings.json @@ -757,10 +757,6 @@ "unified": "Strategi unified diff mengambil beberapa pendekatan untuk menerapkan diff dan memilih pendekatan terbaik.", "multiBlock": "Strategi multi-block diff memungkinkan memperbarui beberapa blok kode dalam file dalam satu permintaan." } - }, - "matchPrecision": { - "label": "Presisi pencocokan", - "description": "Slider ini mengontrol seberapa tepat bagian kode harus cocok saat menerapkan diff. Nilai yang lebih rendah memungkinkan pencocokan yang lebih fleksibel tetapi meningkatkan risiko penggantian yang salah. Gunakan nilai di bawah 100% dengan sangat hati-hati." } }, "todoList": { diff --git a/webview-ui/src/i18n/locales/it/settings.json b/webview-ui/src/i18n/locales/it/settings.json index aebc6d9aa22..a2c741447b1 100644 --- a/webview-ui/src/i18n/locales/it/settings.json +++ b/webview-ui/src/i18n/locales/it/settings.json @@ -753,10 +753,6 @@ "unified": "La strategia diff unificato adotta diversi approcci per applicare i diff e sceglie il migliore.", "multiBlock": "La strategia diff multi-blocco consente di aggiornare più blocchi di codice in un file in una singola richiesta." } - }, - "matchPrecision": { - "label": "Precisione corrispondenza", - "description": "Questo cursore controlla quanto precisamente le sezioni di codice devono corrispondere quando si applicano i diff. Valori più bassi consentono corrispondenze più flessibili ma aumentano il rischio di sostituzioni errate. Usa valori inferiori al 100% con estrema cautela." } }, "todoList": { diff --git a/webview-ui/src/i18n/locales/ja/settings.json b/webview-ui/src/i18n/locales/ja/settings.json index 44a1da4dc4c..052e3677514 100644 --- a/webview-ui/src/i18n/locales/ja/settings.json +++ b/webview-ui/src/i18n/locales/ja/settings.json @@ -753,10 +753,6 @@ "unified": "統合diff戦略はdiffを適用するための複数のアプローチを取り、最良のアプローチを選択します。", "multiBlock": "マルチブロックdiff戦略は、1つのリクエストでファイル内の複数のコードブロックを更新できます。" } - }, - "matchPrecision": { - "label": "マッチ精度", - "description": "このスライダーは、diffを適用する際にコードセクションがどれだけ正確に一致する必要があるかを制御します。低い値はより柔軟なマッチングを可能にしますが、誤った置換のリスクが高まります。100%未満の値は細心の注意を払って使用してください。" } }, "todoList": { diff --git a/webview-ui/src/i18n/locales/ko/settings.json b/webview-ui/src/i18n/locales/ko/settings.json index a810a6162cb..15278d4bcee 100644 --- a/webview-ui/src/i18n/locales/ko/settings.json +++ b/webview-ui/src/i18n/locales/ko/settings.json @@ -753,10 +753,6 @@ "unified": "통합 diff 전략은 diff를 적용하는 여러 접근 방식을 취하고 최상의 접근 방식을 선택합니다.", "multiBlock": "다중 블록 diff 전략은 하나의 요청으로 파일의 여러 코드 블록을 업데이트할 수 있습니다." } - }, - "matchPrecision": { - "label": "일치 정확도", - "description": "이 슬라이더는 diff를 적용할 때 코드 섹션이 얼마나 정확하게 일치해야 하는지 제어합니다. 낮은 값은 더 유연한 일치를 허용하지만 잘못된 교체 위험이 증가합니다. 100% 미만의 값은 극도로 주의해서 사용하세요." } }, "todoList": { diff --git a/webview-ui/src/i18n/locales/nl/settings.json b/webview-ui/src/i18n/locales/nl/settings.json index 10f14ae49de..d7f8eccee47 100644 --- a/webview-ui/src/i18n/locales/nl/settings.json +++ b/webview-ui/src/i18n/locales/nl/settings.json @@ -753,10 +753,6 @@ "unified": "Unified diff-strategie gebruikt meerdere methoden om diffs toe te passen en kiest de beste aanpak.", "multiBlock": "Multi-block diff-strategie laat toe om meerdere codeblokken in één verzoek bij te werken." } - }, - "matchPrecision": { - "label": "Matchnauwkeurigheid", - "description": "Deze schuifregelaar bepaalt hoe nauwkeurig codeblokken moeten overeenkomen bij het toepassen van diffs. Lagere waarden laten flexibelere matching toe maar verhogen het risico op verkeerde vervangingen. Gebruik waarden onder 100% met uiterste voorzichtigheid." } }, "todoList": { diff --git a/webview-ui/src/i18n/locales/pl/settings.json b/webview-ui/src/i18n/locales/pl/settings.json index c958a6e2895..a117be86afd 100644 --- a/webview-ui/src/i18n/locales/pl/settings.json +++ b/webview-ui/src/i18n/locales/pl/settings.json @@ -753,10 +753,6 @@ "unified": "Strategia diff ujednoliconego stosuje wiele podejść do zastosowania różnic i wybiera najlepsze podejście.", "multiBlock": "Strategia diff wieloblokowego pozwala na aktualizację wielu bloków kodu w pliku w jednym żądaniu." } - }, - "matchPrecision": { - "label": "Precyzja dopasowania", - "description": "Ten suwak kontroluje, jak dokładnie sekcje kodu muszą pasować podczas stosowania różnic. Niższe wartości umożliwiają bardziej elastyczne dopasowywanie, ale zwiększają ryzyko nieprawidłowych zamian. Używaj wartości poniżej 100% z najwyższą ostrożnością." } }, "todoList": { diff --git a/webview-ui/src/i18n/locales/pt-BR/settings.json b/webview-ui/src/i18n/locales/pt-BR/settings.json index 062079ad7e3..52de47801d8 100644 --- a/webview-ui/src/i18n/locales/pt-BR/settings.json +++ b/webview-ui/src/i18n/locales/pt-BR/settings.json @@ -753,10 +753,6 @@ "unified": "A estratégia de diff unificado adota várias abordagens para aplicar diffs e escolhe a melhor abordagem.", "multiBlock": "A estratégia de diff multi-bloco permite atualizar vários blocos de código em um arquivo em uma única requisição." } - }, - "matchPrecision": { - "label": "Precisão de correspondência", - "description": "Este controle deslizante controla quão precisamente as seções de código devem corresponder ao aplicar diffs. Valores mais baixos permitem correspondências mais flexíveis, mas aumentam o risco de substituições incorretas. Use valores abaixo de 100% com extrema cautela." } }, "todoList": { diff --git a/webview-ui/src/i18n/locales/ru/settings.json b/webview-ui/src/i18n/locales/ru/settings.json index a908bc2ddf6..76215f47631 100644 --- a/webview-ui/src/i18n/locales/ru/settings.json +++ b/webview-ui/src/i18n/locales/ru/settings.json @@ -753,10 +753,6 @@ "unified": "Унифицированная стратегия использует несколько подходов к применению диффов и выбирает лучший.", "multiBlock": "Мультиблочная стратегия позволяет обновлять несколько блоков кода в файле за один запрос." } - }, - "matchPrecision": { - "label": "Точность совпадения", - "description": "Этот ползунок управляет точностью совпадения секций кода при применении диффов. Меньшие значения позволяют более гибкое совпадение, но увеличивают риск неверной замены. Используйте значения ниже 100% с осторожностью." } }, "todoList": { diff --git a/webview-ui/src/i18n/locales/tr/settings.json b/webview-ui/src/i18n/locales/tr/settings.json index 26d433e0af7..ba7e94dfbea 100644 --- a/webview-ui/src/i18n/locales/tr/settings.json +++ b/webview-ui/src/i18n/locales/tr/settings.json @@ -753,10 +753,6 @@ "unified": "Birleştirilmiş diff stratejisi, diff'leri uygulamak için birden çok yaklaşım benimser ve en iyi yaklaşımı seçer.", "multiBlock": "Çoklu blok diff stratejisi, tek bir istekte bir dosyadaki birden çok kod bloğunu güncellemenize olanak tanır." } - }, - "matchPrecision": { - "label": "Eşleşme hassasiyeti", - "description": "Bu kaydırıcı, diff'ler uygulanırken kod bölümlerinin ne kadar hassas bir şekilde eşleşmesi gerektiğini kontrol eder. Daha düşük değerler daha esnek eşleşmeye izin verir ancak yanlış değiştirme riskini artırır. %100'ün altındaki değerleri son derece dikkatli kullanın." } }, "todoList": { diff --git a/webview-ui/src/i18n/locales/vi/settings.json b/webview-ui/src/i18n/locales/vi/settings.json index 77d3fe7e2a2..30d1d9c4061 100644 --- a/webview-ui/src/i18n/locales/vi/settings.json +++ b/webview-ui/src/i18n/locales/vi/settings.json @@ -753,10 +753,6 @@ "unified": "Chiến lược diff thống nhất thực hiện nhiều cách tiếp cận để áp dụng diff và chọn cách tiếp cận tốt nhất.", "multiBlock": "Chiến lược diff đa khối cho phép cập nhật nhiều khối mã trong một tệp trong một yêu cầu." } - }, - "matchPrecision": { - "label": "Độ chính xác khớp", - "description": "Thanh trượt này kiểm soát mức độ chính xác các phần mã phải khớp khi áp dụng diff. Giá trị thấp hơn cho phép khớp linh hoạt hơn nhưng tăng nguy cơ thay thế không chính xác. Sử dụng giá trị dưới 100% với sự thận trọng cao." } }, "todoList": { diff --git a/webview-ui/src/i18n/locales/zh-CN/settings.json b/webview-ui/src/i18n/locales/zh-CN/settings.json index 5a70cfd10de..6fbbee3e263 100644 --- a/webview-ui/src/i18n/locales/zh-CN/settings.json +++ b/webview-ui/src/i18n/locales/zh-CN/settings.json @@ -753,10 +753,6 @@ "unified": "统一 diff 策略采用多种方法应用差异并选择最佳方法。", "multiBlock": "多块 diff 策略允许在一个请求中更新文件中的多个代码块。" } - }, - "matchPrecision": { - "label": "匹配精度", - "description": "控制代码匹配的精确程度。数值越低匹配越宽松(容错率高但风险大),建议保持100%以确保安全。" } }, "todoList": { diff --git a/webview-ui/src/i18n/locales/zh-TW/settings.json b/webview-ui/src/i18n/locales/zh-TW/settings.json index 88ab5a2c094..7241d041bc4 100644 --- a/webview-ui/src/i18n/locales/zh-TW/settings.json +++ b/webview-ui/src/i18n/locales/zh-TW/settings.json @@ -753,10 +753,6 @@ "unified": "統一差異策略會嘗試多種比對方式,並選擇最佳方案。", "multiBlock": "多區塊策略可在單一請求中更新檔案內的多個程式碼區塊。" } - }, - "matchPrecision": { - "label": "比對精確度", - "description": "此滑桿控制套用差異時程式碼區段的比對精確度。較低的數值允許更彈性的比對,但也會增加錯誤取代的風險。使用低於 100% 的數值時請特別謹慎。" } }, "todoList": { From 2c6ed92d928d661c89135cf1f4fce4c76296cd1f Mon Sep 17 00:00:00 2001 From: Hannes Rudolph Date: Tue, 23 Dec 2025 01:15:08 -0700 Subject: [PATCH 2/2] chore: remove enableDiff from CreateTaskOptions Remove enableDiff property from public CreateTaskOptions interface since diffs are now always enabled. This addresses the review feedback to clean up the no-op property. - Remove enableDiff from packages/types/src/task.ts - Remove enableDiff usage from test file --- packages/types/src/task.ts | 1 - src/core/task/__tests__/Task.spec.ts | 3 --- 2 files changed, 4 deletions(-) diff --git a/packages/types/src/task.ts b/packages/types/src/task.ts index d735073b9a7..00751837c21 100644 --- a/packages/types/src/task.ts +++ b/packages/types/src/task.ts @@ -89,7 +89,6 @@ export type TaskProviderEvents = { */ export interface CreateTaskOptions { - enableDiff?: boolean enableCheckpoints?: boolean consecutiveMistakeLimit?: number experiments?: Record diff --git a/src/core/task/__tests__/Task.spec.ts b/src/core/task/__tests__/Task.spec.ts index 5443996e0e6..03de5500390 100644 --- a/src/core/task/__tests__/Task.spec.ts +++ b/src/core/task/__tests__/Task.spec.ts @@ -1314,7 +1314,6 @@ describe("Cline", () => { const task = new Task({ provider: mockProvider, apiConfiguration: mockApiConfig, - enableDiff: true, task: "test task", startTask: false, }) @@ -1334,7 +1333,6 @@ describe("Cline", () => { const task = new Task({ provider: mockProvider, apiConfiguration: mockApiConfig, - enableDiff: true, task: "test task", startTask: false, }) @@ -1356,7 +1354,6 @@ describe("Cline", () => { const task = new Task({ provider: mockProvider, apiConfiguration: mockApiConfig, - enableDiff: true, task: "test task", startTask: false, })