mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-05 08:10:14 +00:00
fix: gate edit_file by diffEnabled
This commit is contained in:
parent
33f3e402e5
commit
172dd91a19
2 changed files with 15 additions and 1 deletions
|
|
@ -751,7 +751,16 @@ export async function presentAssistantMessage(cline: Task) {
|
|||
block.name as ToolName,
|
||||
mode ?? defaultModeSlug,
|
||||
customModes ?? [],
|
||||
{ apply_diff: cline.diffEnabled },
|
||||
{
|
||||
// diffEnabled should gate ALL edit operations (both XML legacy apply_diff and native edit_file)
|
||||
apply_diff: cline.diffEnabled,
|
||||
edit_file: cline.diffEnabled,
|
||||
edit_file_roo: cline.diffEnabled,
|
||||
edit_file_anthropic: cline.diffEnabled,
|
||||
edit_file_grok: cline.diffEnabled,
|
||||
edit_file_gemini: cline.diffEnabled,
|
||||
edit_file_codex: cline.diffEnabled,
|
||||
},
|
||||
block.params,
|
||||
stateExperiments,
|
||||
includedTools,
|
||||
|
|
|
|||
|
|
@ -167,6 +167,11 @@ describe("mode-validator", () => {
|
|||
// Even in code mode which allows all tools, disabled requirement should take precedence
|
||||
expect(isToolAllowedForMode("write_to_file", codeMode, [], requirements)).toBe(false)
|
||||
})
|
||||
|
||||
it("can gate native unified edit tool (edit_file)", () => {
|
||||
const requirements = { edit_file: false }
|
||||
expect(isToolAllowedForMode("edit_file", codeMode, [], requirements)).toBe(false)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue