Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions apps/cli/src/ui/components/tools/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,7 @@ export type ToolCategory =
| "other"

export function getToolCategory(toolName: string): ToolCategory {
const fileReadTools = [
"readFile",
"read_file",
"fetchInstructions",
"fetch_instructions",
"listFilesTopLevel",
"listFilesRecursive",
"list_files",
]
const fileReadTools = ["readFile", "read_file", "skill", "listFilesTopLevel", "listFilesRecursive", "list_files"]

const fileWriteTools = [
"editedExistingFile",
Expand Down
6 changes: 2 additions & 4 deletions apps/cli/src/ui/components/tools/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ export function getToolDisplayName(toolName: string): string {
// File read operations
readFile: "Read",
read_file: "Read",
fetchInstructions: "Fetch Instructions",
fetch_instructions: "Fetch Instructions",
skill: "Load Skill",
listFilesTopLevel: "List Files",
listFilesRecursive: "List Files (Recursive)",
list_files: "List Files",
Expand Down Expand Up @@ -107,8 +106,7 @@ export function getToolIconName(toolName: string): IconName {
// File read operations
readFile: "file",
read_file: "file",
fetchInstructions: "file",
fetch_instructions: "file",
skill: "file",
listFilesTopLevel: "folder",
listFilesRecursive: "folder",
list_files: "folder",
Expand Down
6 changes: 5 additions & 1 deletion packages/types/src/global-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ export const globalSettingsSchema = z.object({
alwaysAllowWrite: z.boolean().optional(),
alwaysAllowWriteOutsideWorkspace: z.boolean().optional(),
alwaysAllowWriteProtected: z.boolean().optional(),
/**
* Whether diff-based editing tools are enabled.
* When disabled, the extension should avoid providing diff strategies / diff-based tooling.
*/
diffEnabled: z.boolean().optional(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we got rid of diffEnabled?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roomote get rid of any references to diffEnabled in this PR, we got rid of it

Copy link
Contributor

@roomote roomote bot Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Roo Code PR Fixer

Fixed: Removed all diffEnabled references from this PR.

Changes Made:

Type definitions:

  • packages/types/src/global-settings.ts: Removed diffEnabled from Zod schema
  • packages/types/src/vscode-extension-host.ts: Removed diffEnabled from ExtensionState Pick type

Implementation files:

  • src/core/prompts/system.ts: Removed diffEnabled parameter from SYSTEM_PROMPT function signature
  • src/core/webview/ClineProvider.ts: Removed diffEnabled from destructuring, getState(), and getStateToPostToWebview()
  • src/core/webview/generateSystemPrompt.ts: Removed diffEnabled argument from SYSTEM_PROMPT call
  • src/core/task/Task.ts: Removed diffEnabled argument from getSystemPrompt() call

Test files:

  • src/core/webview/__tests__/ClineProvider.spec.ts: Removed diffEnabled from mock state, removed property expectation, removed 3 test cases for diff enabled/disabled
  • src/core/prompts/__tests__/system-prompt.spec.ts: Removed diffEnabled parameter from all SYSTEM_PROMPT calls, removed 3 test cases specifically testing diffEnabled behavior
  • src/core/prompts/__tests__/add-custom-instructions.spec.ts: Removed diffEnabled parameter from all SYSTEM_PROMPT calls

Verification:

  • TypeScript type check: Passed
  • All tests pass: 117 tests passed (6 skipped - pre-existing)
  • ESLint: No warnings or errors

Commit: f997890

writeDelayMs: z.number().min(0).optional(),
alwaysAllowBrowser: z.boolean().optional(),
requestDelaySeconds: z.number().optional(),
Expand Down Expand Up @@ -199,7 +204,6 @@ export const globalSettingsSchema = z.object({
telemetrySetting: telemetrySettingsSchema.optional(),

mcpEnabled: z.boolean().optional(),
enableMcpServerCreation: z.boolean().optional(),

mode: z.string().optional(),
modeApiConfigs: z.record(z.string(), z.string()).optional(),
Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ export const toolNames = [
"attempt_completion",
"switch_mode",
"new_task",
"fetch_instructions",
"codebase_search",
"update_todo_list",
"run_slash_command",
"skill",
"generate_image",
"custom_tool",
] as const
Expand Down
7 changes: 4 additions & 3 deletions packages/types/src/vscode-extension-host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ export type ExtensionState = Pick<
| "alwaysAllowWrite"
| "alwaysAllowWriteOutsideWorkspace"
| "alwaysAllowWriteProtected"
| "diffEnabled"
| "alwaysAllowBrowser"
| "alwaysAllowMcp"
| "alwaysAllowModeSwitch"
Expand Down Expand Up @@ -359,7 +360,6 @@ export type ExtensionState = Pick<
experiments: Experiments // Map of experiment IDs to their enabled state

mcpEnabled: boolean
enableMcpServerCreation: boolean

mode: string
customModes: ModeConfig[]
Expand Down Expand Up @@ -499,7 +499,6 @@ export interface WebviewMessage {
| "deleteMessageConfirm"
| "submitEditedMessage"
| "editMessageConfirm"
| "enableMcpServerCreation"
| "remoteControlEnabled"
| "taskSyncEnabled"
| "searchCommits"
Expand Down Expand Up @@ -779,7 +778,6 @@ export interface ClineSayTool {
| "codebaseSearch"
| "readFile"
| "readCommandOutput"
| "fetchInstructions"
| "listFilesTopLevel"
| "listFilesRecursive"
| "searchFiles"
Expand All @@ -790,6 +788,7 @@ export interface ClineSayTool {
| "imageGenerated"
| "runSlashCommand"
| "updateTodoList"
| "skill"
path?: string
// For readCommandOutput
readStart?: number
Expand Down Expand Up @@ -836,6 +835,8 @@ export interface ClineSayTool {
args?: string
source?: string
description?: string
// Properties for skill tool
skill?: string
}

// Must keep in sync with system prompt.
Expand Down
34 changes: 18 additions & 16 deletions src/core/assistant-message/NativeToolCallParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,14 +449,6 @@ export class NativeToolCallParser {
}
break

case "fetch_instructions":
if (partialArgs.task !== undefined) {
nativeArgs = {
task: partialArgs.task,
}
}
break

case "generate_image":
if (partialArgs.prompt !== undefined || partialArgs.path !== undefined) {
nativeArgs = {
Expand All @@ -476,6 +468,15 @@ export class NativeToolCallParser {
}
break

case "skill":
if (partialArgs.skill !== undefined) {
nativeArgs = {
skill: partialArgs.skill,
args: partialArgs.args,
}
}
break

case "search_files":
if (partialArgs.path !== undefined || partialArgs.regex !== undefined) {
nativeArgs = {
Expand Down Expand Up @@ -736,14 +737,6 @@ export class NativeToolCallParser {
}
break

case "fetch_instructions":
if (args.task !== undefined) {
nativeArgs = {
task: args.task,
} as NativeArgsFor<TName>
}
break

case "generate_image":
if (args.prompt !== undefined && args.path !== undefined) {
nativeArgs = {
Expand All @@ -763,6 +756,15 @@ export class NativeToolCallParser {
}
break

case "skill":
if (args.skill !== undefined) {
nativeArgs = {
skill: args.skill,
args: args.args,
} as NativeArgsFor<TName>
}
break

case "search_files":
if (args.path !== undefined && args.regex !== undefined) {
nativeArgs = {
Expand Down
21 changes: 10 additions & 11 deletions src/core/assistant-message/presentAssistantMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import type { ToolParamName, ToolResponse, ToolUse, McpToolUse } from "../../sha
import { AskIgnoredError } from "../task/AskIgnoredError"
import { Task } from "../task/Task"

import { fetchInstructionsTool } from "../tools/FetchInstructionsTool"
import { listFilesTool } from "../tools/ListFilesTool"
import { readFileTool } from "../tools/ReadFileTool"
import { readCommandOutputTool } from "../tools/ReadCommandOutputTool"
Expand All @@ -34,6 +33,7 @@ import { attemptCompletionTool, AttemptCompletionCallbacks } from "../tools/Atte
import { newTaskTool } from "../tools/NewTaskTool"
import { updateTodoListTool } from "../tools/UpdateTodoListTool"
import { runSlashCommandTool } from "../tools/RunSlashCommandTool"
import { skillTool } from "../tools/SkillTool"
import { generateImageTool } from "../tools/GenerateImageTool"
import { applyDiffTool as applyDiffToolClass } from "../tools/ApplyDiffTool"
import { isValidToolName, validateToolUse } from "../tools/validateToolUse"
Expand Down Expand Up @@ -370,8 +370,6 @@ export async function presentAssistantMessage(cline: Task) {
return readFileTool.getReadFileToolDescription(block.name, block.nativeArgs)
}
return readFileTool.getReadFileToolDescription(block.name, block.params)
case "fetch_instructions":
return `[${block.name} for '${block.params.task}']`
case "write_to_file":
return `[${block.name} for '${block.params.path}']`
case "apply_diff":
Expand Down Expand Up @@ -417,6 +415,8 @@ export async function presentAssistantMessage(cline: Task) {
}
case "run_slash_command":
return `[${block.name} for '${block.params.command}'${block.params.args ? ` with args: ${block.params.args}` : ""}]`
case "skill":
return `[${block.name} for '${block.params.skill}'${block.params.args ? ` with args: ${block.params.args}` : ""}]`
case "generate_image":
return `[${block.name} for '${block.params.path}']`
default:
Expand Down Expand Up @@ -805,13 +805,6 @@ export async function presentAssistantMessage(cline: Task) {
pushToolResult,
})
break
case "fetch_instructions":
await fetchInstructionsTool.handle(cline, block as ToolUse<"fetch_instructions">, {
askApproval,
handleError,
pushToolResult,
})
break
case "list_files":
await listFilesTool.handle(cline, block as ToolUse<"list_files">, {
askApproval,
Expand Down Expand Up @@ -915,6 +908,13 @@ export async function presentAssistantMessage(cline: Task) {
pushToolResult,
})
break
case "skill":
await skillTool.handle(cline, block as ToolUse<"skill">, {
askApproval,
handleError,
pushToolResult,
})
break
case "generate_image":
await checkpointSaveAndMark(cline)
await generateImageTool.handle(cline, block as ToolUse<"generate_image">, {
Expand Down Expand Up @@ -1094,7 +1094,6 @@ function containsXmlToolMarkup(text: string): boolean {
"codebase_search",
"edit_file",
"execute_command",
"fetch_instructions",
"generate_image",
"list_files",
"new_task",
Expand Down
13 changes: 5 additions & 8 deletions src/core/auto-approval/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,11 @@ export async function checkAutoApproval({
return { decision: "approve" }
}

if (tool?.tool === "fetchInstructions") {
if (tool.content === "create_mode") {
return state.alwaysAllowModeSwitch === true ? { decision: "approve" } : { decision: "ask" }
}

if (tool.content === "create_mcp_server") {
return state.alwaysAllowMcp === true ? { decision: "approve" } : { decision: "ask" }
}
// The skill tool only loads pre-defined instructions from built-in, global, or project skills.
// It does not read arbitrary files - skills must be explicitly installed/defined by the user.
// Auto-approval is intentional to provide a seamless experience when loading task instructions.
if (tool.tool === "skill") {
return { decision: "approve" }
}

if (tool?.tool === "switchMode") {
Expand Down
8 changes: 4 additions & 4 deletions src/core/prompts/__tests__/add-custom-instructions.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ describe("addCustomInstructions", () => {
undefined, // customModePrompts
undefined, // customModes
undefined, // globalCustomInstructions
undefined, // diffEnabled
undefined, // experiments
true, // enableMcpServerCreation
undefined, // language
undefined, // rooIgnoreInstructions
undefined, // partialReadsEnabled
Expand All @@ -232,8 +232,8 @@ describe("addCustomInstructions", () => {
undefined, // customModePrompts
undefined, // customModes
undefined, // globalCustomInstructions
undefined, // diffEnabled
undefined, // experiments
true, // enableMcpServerCreation
undefined, // language
undefined, // rooIgnoreInstructions
undefined, // partialReadsEnabled
Expand All @@ -256,8 +256,8 @@ describe("addCustomInstructions", () => {
undefined, // customModePrompts
undefined, // customModes,
undefined, // globalCustomInstructions
undefined, // diffEnabled
undefined, // experiments
false, // enableMcpServerCreation
undefined, // language
undefined, // rooIgnoreInstructions
undefined, // partialReadsEnabled
Expand All @@ -279,8 +279,8 @@ describe("addCustomInstructions", () => {
undefined, // customModePrompts
undefined, // customModes,
undefined, // globalCustomInstructions
undefined, // diffEnabled
undefined, // experiments
true, // enableMcpServerCreation
undefined, // language
undefined, // rooIgnoreInstructions
true, // partialReadsEnabled
Expand Down
3 changes: 0 additions & 3 deletions src/core/prompts/__tests__/custom-system-prompt.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ describe("File-Based Custom System Prompt", () => {
undefined, // customModes
undefined, // globalCustomInstructions
undefined, // experiments
true, // enableMcpServerCreation
undefined, // language
undefined, // rooIgnoreInstructions
undefined, // partialReadsEnabled
Expand Down Expand Up @@ -142,7 +141,6 @@ describe("File-Based Custom System Prompt", () => {
undefined, // customModes
undefined, // globalCustomInstructions
undefined, // experiments
true, // enableMcpServerCreation
undefined, // language
undefined, // rooIgnoreInstructions
undefined, // partialReadsEnabled
Expand Down Expand Up @@ -187,7 +185,6 @@ describe("File-Based Custom System Prompt", () => {
undefined, // customModes
undefined, // globalCustomInstructions
undefined, // experiments
true, // enableMcpServerCreation
undefined, // language
undefined, // rooIgnoreInstructions
undefined, // partialReadsEnabled
Expand Down
Loading
Loading