Skip to content

Commit f997890

Browse files
committed
Remove all diffEnabled references per review request
- Remove diffEnabled from global-settings.ts Zod schema - Remove diffEnabled from ExtensionState Pick type in vscode-extension-host.ts - Remove diffEnabled parameter from SYSTEM_PROMPT function signature in system.ts - Remove diffEnabled from ClineProvider.ts (destructuring, getState, getStateToPostToWebview) - Remove diffEnabled from generateSystemPrompt.ts - Remove diffEnabled from Task.ts getSystemPrompt call - Remove diffEnabled from test files (ClineProvider.spec.ts, system-prompt.spec.ts, add-custom-instructions.spec.ts) - Remove test cases specifically testing diffEnabled behavior
1 parent 2420ff7 commit f997890

File tree

9 files changed

+1
-190
lines changed

9 files changed

+1
-190
lines changed

packages/types/src/global-settings.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,6 @@ export const globalSettingsSchema = z.object({
100100
alwaysAllowWrite: z.boolean().optional(),
101101
alwaysAllowWriteOutsideWorkspace: z.boolean().optional(),
102102
alwaysAllowWriteProtected: z.boolean().optional(),
103-
/**
104-
* Whether diff-based editing tools are enabled.
105-
* When disabled, the extension should avoid providing diff strategies / diff-based tooling.
106-
*/
107-
diffEnabled: z.boolean().optional(),
108103
writeDelayMs: z.number().min(0).optional(),
109104
alwaysAllowBrowser: z.boolean().optional(),
110105
requestDelaySeconds: z.number().optional(),

packages/types/src/vscode-extension-host.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ export type ExtensionState = Pick<
280280
| "alwaysAllowWrite"
281281
| "alwaysAllowWriteOutsideWorkspace"
282282
| "alwaysAllowWriteProtected"
283-
| "diffEnabled"
284283
| "alwaysAllowBrowser"
285284
| "alwaysAllowMcp"
286285
| "alwaysAllowModeSwitch"

src/core/prompts/__tests__/add-custom-instructions.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ describe("addCustomInstructions", () => {
210210
undefined, // customModePrompts
211211
undefined, // customModes
212212
undefined, // globalCustomInstructions
213-
undefined, // diffEnabled
214213
undefined, // experiments
215214
undefined, // language
216215
undefined, // rooIgnoreInstructions
@@ -232,7 +231,6 @@ describe("addCustomInstructions", () => {
232231
undefined, // customModePrompts
233232
undefined, // customModes
234233
undefined, // globalCustomInstructions
235-
undefined, // diffEnabled
236234
undefined, // experiments
237235
undefined, // language
238236
undefined, // rooIgnoreInstructions
@@ -256,7 +254,6 @@ describe("addCustomInstructions", () => {
256254
undefined, // customModePrompts
257255
undefined, // customModes,
258256
undefined, // globalCustomInstructions
259-
undefined, // diffEnabled
260257
undefined, // experiments
261258
undefined, // language
262259
undefined, // rooIgnoreInstructions
@@ -279,7 +276,6 @@ describe("addCustomInstructions", () => {
279276
undefined, // customModePrompts
280277
undefined, // customModes,
281278
undefined, // globalCustomInstructions
282-
undefined, // diffEnabled
283279
undefined, // experiments
284280
undefined, // language
285281
undefined, // rooIgnoreInstructions

src/core/prompts/__tests__/system-prompt.spec.ts

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ describe("SYSTEM_PROMPT", () => {
225225
undefined, // customModePrompts
226226
undefined, // customModes
227227
undefined, // globalCustomInstructions
228-
undefined, // diffEnabled
229228
experiments,
230229
undefined, // language
231230
undefined, // rooIgnoreInstructions
@@ -247,7 +246,6 @@ describe("SYSTEM_PROMPT", () => {
247246
undefined, // customModePrompts
248247
undefined, // customModes,
249248
undefined, // globalCustomInstructions
250-
undefined, // diffEnabled
251249
experiments,
252250
undefined, // language
253251
undefined, // rooIgnoreInstructions
@@ -271,7 +269,6 @@ describe("SYSTEM_PROMPT", () => {
271269
undefined, // customModePrompts
272270
undefined, // customModes,
273271
undefined, // globalCustomInstructions
274-
undefined, // diffEnabled
275272
experiments,
276273
undefined, // language
277274
undefined, // rooIgnoreInstructions
@@ -293,7 +290,6 @@ describe("SYSTEM_PROMPT", () => {
293290
undefined, // customModePrompts
294291
undefined, // customModes,
295292
undefined, // globalCustomInstructions
296-
undefined, // diffEnabled
297293
experiments,
298294
undefined, // language
299295
undefined, // rooIgnoreInstructions
@@ -315,7 +311,6 @@ describe("SYSTEM_PROMPT", () => {
315311
undefined, // customModePrompts
316312
undefined, // customModes,
317313
undefined, // globalCustomInstructions
318-
undefined, // diffEnabled
319314
experiments,
320315
undefined, // language
321316
undefined, // rooIgnoreInstructions
@@ -325,81 +320,6 @@ describe("SYSTEM_PROMPT", () => {
325320
expect(prompt).toMatchFileSnapshot("./__snapshots__/system-prompt/with-different-viewport-size.snap")
326321
})
327322

328-
it("should include diff strategy tool description when diffEnabled is true", async () => {
329-
const prompt = await SYSTEM_PROMPT(
330-
mockContext,
331-
"/test/path",
332-
false,
333-
undefined, // mcpHub
334-
new MultiSearchReplaceDiffStrategy(), // Use actual diff strategy from the codebase
335-
undefined, // browserViewportSize
336-
defaultModeSlug, // mode
337-
undefined, // customModePrompts
338-
undefined, // customModes
339-
undefined, // globalCustomInstructions
340-
true, // diffEnabled
341-
experiments,
342-
undefined, // language
343-
undefined, // rooIgnoreInstructions
344-
undefined, // partialReadsEnabled
345-
)
346-
347-
// Native-only: tool catalog isn't embedded in the system prompt anymore.
348-
expect(prompt).not.toContain("# Tools")
349-
expect(prompt).not.toContain("apply_diff")
350-
expect(prompt).toMatchFileSnapshot("./__snapshots__/system-prompt/with-diff-enabled-true.snap")
351-
})
352-
353-
it("should exclude diff strategy tool description when diffEnabled is false", async () => {
354-
const prompt = await SYSTEM_PROMPT(
355-
mockContext,
356-
"/test/path",
357-
false, // supportsImages
358-
undefined, // mcpHub
359-
new MultiSearchReplaceDiffStrategy(), // Use actual diff strategy from the codebase
360-
undefined, // browserViewportSize
361-
defaultModeSlug, // mode
362-
undefined, // customModePrompts
363-
undefined, // customModes
364-
undefined, // globalCustomInstructions
365-
false, // diffEnabled
366-
experiments,
367-
undefined, // language
368-
undefined, // rooIgnoreInstructions
369-
undefined, // partialReadsEnabled
370-
)
371-
372-
// Native-only: tool catalog isn't embedded in the system prompt anymore.
373-
expect(prompt).not.toContain("# Tools")
374-
expect(prompt).not.toContain("apply_diff")
375-
expect(prompt).toMatchFileSnapshot("./__snapshots__/system-prompt/with-diff-enabled-false.snap")
376-
})
377-
378-
it("should exclude diff strategy tool description when diffEnabled is undefined", async () => {
379-
const prompt = await SYSTEM_PROMPT(
380-
mockContext,
381-
"/test/path",
382-
false,
383-
undefined, // mcpHub
384-
new MultiSearchReplaceDiffStrategy(), // Use actual diff strategy from the codebase
385-
undefined, // browserViewportSize
386-
defaultModeSlug, // mode
387-
undefined, // customModePrompts
388-
undefined, // customModes
389-
undefined, // globalCustomInstructions
390-
undefined, // diffEnabled
391-
experiments,
392-
undefined, // language
393-
undefined, // rooIgnoreInstructions
394-
undefined, // partialReadsEnabled
395-
)
396-
397-
// Native-only: tool catalog isn't embedded in the system prompt anymore.
398-
expect(prompt).not.toContain("# Tools")
399-
expect(prompt).not.toContain("apply_diff")
400-
expect(prompt).toMatchFileSnapshot("./__snapshots__/system-prompt/with-diff-enabled-undefined.snap")
401-
})
402-
403323
it("should include vscode language in custom instructions", async () => {
404324
// Mock vscode.env.language
405325
const vscode = vi.mocked(await import("vscode")) as any
@@ -439,7 +359,6 @@ describe("SYSTEM_PROMPT", () => {
439359
undefined, // customModePrompts
440360
undefined, // customModes
441361
undefined, // globalCustomInstructions
442-
undefined, // diffEnabled
443362
undefined, // experiments
444363
undefined, // language
445364
undefined, // rooIgnoreInstructions
@@ -499,7 +418,6 @@ describe("SYSTEM_PROMPT", () => {
499418
undefined, // customModePrompts
500419
customModes, // customModes
501420
"Global instructions", // globalCustomInstructions
502-
undefined, // diffEnabled
503421
experiments,
504422
undefined, // language
505423
undefined, // rooIgnoreInstructions
@@ -536,7 +454,6 @@ describe("SYSTEM_PROMPT", () => {
536454
customModePrompts, // customModePrompts
537455
undefined, // customModes
538456
undefined, // globalCustomInstructions
539-
undefined, // diffEnabled
540457
undefined, // experiments
541458
undefined, // language
542459
undefined, // rooIgnoreInstructions
@@ -568,7 +485,6 @@ describe("SYSTEM_PROMPT", () => {
568485
customModePrompts, // customModePrompts
569486
undefined, // customModes
570487
undefined, // globalCustomInstructions
571-
undefined, // diffEnabled
572488
undefined, // experiments
573489
undefined, // language
574490
undefined, // rooIgnoreInstructions
@@ -598,7 +514,6 @@ describe("SYSTEM_PROMPT", () => {
598514
undefined, // customModePrompts
599515
undefined, // customModes
600516
undefined, // globalCustomInstructions
601-
undefined, // diffEnabled
602517
experiments,
603518
undefined, // language
604519
undefined, // rooIgnoreInstructions
@@ -630,7 +545,6 @@ describe("SYSTEM_PROMPT", () => {
630545
undefined, // customModePrompts
631546
undefined, // customModes
632547
undefined, // globalCustomInstructions
633-
undefined, // diffEnabled
634548
experiments,
635549
undefined, // language
636550
undefined, // rooIgnoreInstructions
@@ -662,7 +576,6 @@ describe("SYSTEM_PROMPT", () => {
662576
undefined, // customModePrompts
663577
undefined, // customModes
664578
undefined, // globalCustomInstructions
665-
undefined, // diffEnabled
666579
experiments,
667580
undefined, // language
668581
undefined, // rooIgnoreInstructions
@@ -694,7 +607,6 @@ describe("SYSTEM_PROMPT", () => {
694607
undefined, // customModePrompts
695608
undefined, // customModes
696609
undefined, // globalCustomInstructions
697-
undefined, // diffEnabled
698610
experiments,
699611
undefined, // language
700612
undefined, // rooIgnoreInstructions

src/core/prompts/system.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ async function generatePrompt(
5252
promptComponent?: PromptComponent,
5353
customModeConfigs?: ModeConfig[],
5454
globalCustomInstructions?: string,
55-
diffEnabled?: boolean,
5655
experiments?: Record<string, boolean>,
5756
language?: string,
5857
rooIgnoreInstructions?: string,
@@ -66,9 +65,6 @@ async function generatePrompt(
6665
throw new Error("Extension context is required for generating system prompt")
6766
}
6867

69-
// If diff is disabled, don't pass the diffStrategy
70-
const effectiveDiffStrategy = diffEnabled ? diffStrategy : undefined
71-
7268
// Get the full mode config to ensure we have the role definition (used for groups, etc.)
7369
const modeConfig = getModeBySlug(mode, customModeConfigs) || modes.find((m) => m.slug === mode) || modes[0]
7470
const { roleDefinition, baseInstructions } = getModeSelection(mode, promptComponent, customModeConfigs)
@@ -129,7 +125,6 @@ export const SYSTEM_PROMPT = async (
129125
customModePrompts?: CustomModePrompts,
130126
customModes?: ModeConfig[],
131127
globalCustomInstructions?: string,
132-
diffEnabled?: boolean,
133128
experiments?: Record<string, boolean>,
134129
language?: string,
135130
rooIgnoreInstructions?: string,
@@ -187,21 +182,17 @@ ${fileCustomSystemPrompt}
187182
${customInstructions}`
188183
}
189184

190-
// If diff is disabled, don't pass the diffStrategy
191-
const effectiveDiffStrategy = diffEnabled ? diffStrategy : undefined
192-
193185
return generatePrompt(
194186
context,
195187
cwd,
196188
supportsComputerUse,
197189
currentMode.slug,
198190
mcpHub,
199-
effectiveDiffStrategy,
191+
diffStrategy,
200192
browserViewportSize,
201193
promptComponent,
202194
customModes,
203195
globalCustomInstructions,
204-
diffEnabled,
205196
experiments,
206197
language,
207198
rooIgnoreInstructions,

src/core/task/Task.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3795,7 +3795,6 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
37953795
customModePrompts,
37963796
customModes,
37973797
customInstructions,
3798-
undefined, // diffEnabled
37993798
experiments,
38003799
language,
38013800
rooIgnoreInstructions,

src/core/webview/ClineProvider.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,7 +1991,6 @@ export class ClineProvider
19911991
alwaysAllowWrite,
19921992
alwaysAllowWriteOutsideWorkspace,
19931993
alwaysAllowWriteProtected,
1994-
diffEnabled,
19951994
alwaysAllowExecute,
19961995
allowedCommands,
19971996
deniedCommands,
@@ -2117,7 +2116,6 @@ export class ClineProvider
21172116
alwaysAllowWrite: alwaysAllowWrite ?? false,
21182117
alwaysAllowWriteOutsideWorkspace: alwaysAllowWriteOutsideWorkspace ?? false,
21192118
alwaysAllowWriteProtected: alwaysAllowWriteProtected ?? false,
2120-
diffEnabled: diffEnabled ?? true,
21212119
alwaysAllowExecute: alwaysAllowExecute ?? false,
21222120
alwaysAllowBrowser: alwaysAllowBrowser ?? false,
21232121
alwaysAllowMcp: alwaysAllowMcp ?? false,
@@ -2368,7 +2366,6 @@ export class ClineProvider
23682366
alwaysAllowWrite: stateValues.alwaysAllowWrite ?? false,
23692367
alwaysAllowWriteOutsideWorkspace: stateValues.alwaysAllowWriteOutsideWorkspace ?? false,
23702368
alwaysAllowWriteProtected: stateValues.alwaysAllowWriteProtected ?? false,
2371-
diffEnabled: stateValues.diffEnabled ?? true,
23722369
alwaysAllowExecute: stateValues.alwaysAllowExecute ?? false,
23732370
alwaysAllowBrowser: stateValues.alwaysAllowBrowser ?? false,
23742371
alwaysAllowMcp: stateValues.alwaysAllowMcp ?? false,

0 commit comments

Comments
 (0)