diff --git a/src/core/tools/applyDiffTool.ts b/src/core/tools/applyDiffTool.ts index d4f7fd883f9..c89fe8b735a 100644 --- a/src/core/tools/applyDiffTool.ts +++ b/src/core/tools/applyDiffTool.ts @@ -147,9 +147,13 @@ export async function applyDiffToolLegacy( await cline.diffViewProvider.update(diffResult.content, true) await cline.diffViewProvider.scrollToFirstDiff() + // Check if file is write-protected + const isWriteProtected = cline.rooProtectedController?.isWriteProtected(relPath) || false + const completeMessage = JSON.stringify({ ...sharedMessageProps, diff: diffContent, + isProtected: isWriteProtected, } satisfies ClineSayTool) let toolProgressStatus @@ -158,7 +162,7 @@ export async function applyDiffToolLegacy( toolProgressStatus = cline.diffStrategy.getProgressStatus(block, diffResult) } - const didApprove = await askApproval("tool", completeMessage, toolProgressStatus) + const didApprove = await askApproval("tool", completeMessage, toolProgressStatus, isWriteProtected) if (!didApprove) { await cline.diffViewProvider.revertChanges() // Cline likely handles closing the diff view