diff --git a/src/core/tools/insertContentTool.ts b/src/core/tools/insertContentTool.ts index bcb217326a..910bed5fe4 100644 --- a/src/core/tools/insertContentTool.ts +++ b/src/core/tools/insertContentTool.ts @@ -58,6 +58,14 @@ export async function insertContentTool( return } + const accessAllowed = cline.rooIgnoreController?.validateAccess(relPath) + + if (!accessAllowed) { + await cline.say("rooignore_error", relPath) + pushToolResult(formatResponse.toolError(formatResponse.rooIgnoreError(relPath))) + return + } + const absolutePath = path.resolve(cline.cwd, relPath) const fileExists = await fileExistsAtPath(absolutePath) diff --git a/src/core/tools/searchAndReplaceTool.ts b/src/core/tools/searchAndReplaceTool.ts index 417e2046df..de98fcafea 100644 --- a/src/core/tools/searchAndReplaceTool.ts +++ b/src/core/tools/searchAndReplaceTool.ts @@ -115,6 +115,14 @@ export async function searchAndReplaceTool( endLine: endLine, } + const accessAllowed = cline.rooIgnoreController?.validateAccess(validRelPath) + + if (!accessAllowed) { + await cline.say("rooignore_error", validRelPath) + pushToolResult(formatResponse.toolError(formatResponse.rooIgnoreError(validRelPath))) + return + } + const absolutePath = path.resolve(cline.cwd, validRelPath) const fileExists = await fileExistsAtPath(absolutePath)