From 454372a4ee699c43c77023b9ce7c64ffd24f309c Mon Sep 17 00:00:00 2001 From: Roo Code Date: Tue, 10 Feb 2026 22:36:16 +0000 Subject: [PATCH] fix: exclude desktop.ini from rule file ingestion --- .../sections/__tests__/custom-instructions.spec.ts | 11 +++++++++++ src/core/prompts/sections/custom-instructions.ts | 1 + 2 files changed, 12 insertions(+) diff --git a/src/core/prompts/sections/__tests__/custom-instructions.spec.ts b/src/core/prompts/sections/__tests__/custom-instructions.spec.ts index 68fa2d37f5a..7d723201319 100644 --- a/src/core/prompts/sections/__tests__/custom-instructions.spec.ts +++ b/src/core/prompts/sections/__tests__/custom-instructions.spec.ts @@ -242,6 +242,12 @@ describe("loadRuleFiles", () => { readdirMock.mockResolvedValueOnce([ { name: "rule1.txt", isFile: () => true, isSymbolicLink: () => false, parentPath: "/fake/path/.roo/rules" }, { name: ".DS_Store", isFile: () => true, isSymbolicLink: () => false, parentPath: "/fake/path/.roo/rules" }, + { + name: "desktop.ini", + isFile: () => true, + isSymbolicLink: () => false, + parentPath: "/fake/path/.roo/rules", + }, { name: "Thumbs.db", isFile: () => true, isSymbolicLink: () => false, parentPath: "/fake/path/.roo/rules" }, { name: "rule2.md", isFile: () => true, isSymbolicLink: () => false, parentPath: "/fake/path/.roo/rules" }, { name: "cache.log", isFile: () => true, isSymbolicLink: () => false, parentPath: "/fake/path/.roo/rules" }, @@ -283,6 +289,9 @@ describe("loadRuleFiles", () => { if (normalizedPath === "/fake/path/.roo/rules/.DS_Store") { return Promise.resolve("DS_STORE_BINARY_CONTENT") } + if (normalizedPath === "/fake/path/.roo/rules/desktop.ini") { + return Promise.resolve("DESKTOP_INI_CONTENT") + } if (normalizedPath === "/fake/path/.roo/rules/Thumbs.db") { return Promise.resolve("THUMBS_DB_CONTENT") } @@ -310,6 +319,7 @@ describe("loadRuleFiles", () => { // Should NOT contain cache file content - they should be filtered out expect(result).not.toContain("DS_STORE_BINARY_CONTENT") + expect(result).not.toContain("DESKTOP_INI_CONTENT") expect(result).not.toContain("THUMBS_DB_CONTENT") expect(result).not.toContain("BACKUP_CONTENT") expect(result).not.toContain("LOG_CONTENT") @@ -319,6 +329,7 @@ describe("loadRuleFiles", () => { // Verify cache files are not read at all const expectedCacheFiles = [ "/fake/path/.roo/rules/.DS_Store", + "/fake/path/.roo/rules/desktop.ini", "/fake/path/.roo/rules/Thumbs.db", "/fake/path/.roo/rules/backup.bak", "/fake/path/.roo/rules/cache.log", diff --git a/src/core/prompts/sections/custom-instructions.ts b/src/core/prompts/sections/custom-instructions.ts index 46cf1bf1f9e..bb5cadc1c46 100644 --- a/src/core/prompts/sections/custom-instructions.ts +++ b/src/core/prompts/sections/custom-instructions.ts @@ -534,6 +534,7 @@ function shouldIncludeRuleFile(filename: string): boolean { "*.swp", "*.temp", "*.tmp", + "desktop.ini", "Thumbs.db", ]