mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-08 22:21:23 +00:00
fix: exclude apply_diff from native tools when diffEnabled is false (#9920)
Co-authored-by: Roo Code <roomote@roocode.com>
This commit is contained in:
parent
ee48b3a1ae
commit
375c103bd3
3 changed files with 9 additions and 0 deletions
|
|
@ -153,6 +153,11 @@ 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")
|
||||
|
|
|
|||
|
|
@ -3661,6 +3661,7 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
|
|||
maxReadFileLine: state?.maxReadFileLine ?? -1,
|
||||
browserToolEnabled: state?.browserToolEnabled ?? true,
|
||||
modelInfo,
|
||||
diffEnabled: this.diffEnabled,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ interface BuildToolsOptions {
|
|||
maxReadFileLine: number
|
||||
browserToolEnabled: boolean
|
||||
modelInfo?: ModelInfo
|
||||
diffEnabled: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -34,6 +35,7 @@ export async function buildNativeToolsArray(options: BuildToolsOptions): Promise
|
|||
maxReadFileLine,
|
||||
browserToolEnabled,
|
||||
modelInfo,
|
||||
diffEnabled,
|
||||
} = options
|
||||
|
||||
const mcpHub = provider.getMcpHub()
|
||||
|
|
@ -47,6 +49,7 @@ 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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue