From 8d665dd597fe0e2c621e99658c53407942fa3327 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Feb 2026 12:12:46 +0000 Subject: [PATCH 1/8] Initial plan From 63f10bbf22daec92ef9df6b2d2f195e7a538c670 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Feb 2026 12:18:04 +0000 Subject: [PATCH 2/8] Initial plan for neutralizeBotTriggers update Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- .github/workflows/smoke-gemini.lock.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke-gemini.lock.yml b/.github/workflows/smoke-gemini.lock.yml index d1d6955c67..3e2b7c571b 100644 --- a/.github/workflows/smoke-gemini.lock.yml +++ b/.github/workflows/smoke-gemini.lock.yml @@ -404,7 +404,7 @@ jobs: version: "", agent_version: "", workflow_name: "Smoke Gemini", - experimental: true, + experimental: false, supports_tools_allowlist: true, run_id: context.runId, run_number: context.runNumber, From 50012c6ba5bc4c1a75b6f77555604e6ae878b087 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Feb 2026 12:25:04 +0000 Subject: [PATCH 3/8] Update neutralizeBotTriggers to allow up to 10 references before filtering Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --- actions/setup/js/sanitize_content.test.cjs | 46 ++++++++++++++++------ actions/setup/js/sanitize_content_core.cjs | 20 ++++++++-- 2 files changed, 52 insertions(+), 14 deletions(-) diff --git a/actions/setup/js/sanitize_content.test.cjs b/actions/setup/js/sanitize_content.test.cjs index 668663c1c1..610a435bef 100644 --- a/actions/setup/js/sanitize_content.test.cjs +++ b/actions/setup/js/sanitize_content.test.cjs @@ -746,32 +746,56 @@ describe("sanitize_content.cjs", () => { }); describe("bot trigger neutralization", () => { - it("should neutralize 'fixes #123' patterns", () => { + it("should not neutralize 'fixes #123' when there are 10 or fewer references", () => { const result = sanitizeContent("This fixes #123"); - expect(result).toBe("This `fixes #123`"); + expect(result).toBe("This fixes #123"); }); - it("should neutralize 'closes #456' patterns", () => { + it("should not neutralize 'closes #456' when there are 10 or fewer references", () => { const result = sanitizeContent("PR closes #456"); - expect(result).toBe("PR `closes #456`"); + expect(result).toBe("PR closes #456"); }); - it("should neutralize 'resolves #789' patterns", () => { + it("should not neutralize 'resolves #789' when there are 10 or fewer references", () => { const result = sanitizeContent("This resolves #789"); - expect(result).toBe("This `resolves #789`"); + expect(result).toBe("This resolves #789"); }); - it("should handle various bot trigger verbs", () => { + it("should not neutralize various bot trigger verbs when count is within limit", () => { const triggers = ["fix", "fixes", "close", "closes", "resolve", "resolves"]; triggers.forEach(verb => { const result = sanitizeContent(`This ${verb} #123`); - expect(result).toBe(`This \`${verb} #123\``); + expect(result).toBe(`This ${verb} #123`); }); }); - it("should neutralize alphanumeric issue references", () => { + it("should not neutralize alphanumeric issue references when count is within limit", () => { const result = sanitizeContent("fixes #abc123def"); - expect(result).toBe("`fixes #abc123def`"); + expect(result).toBe("fixes #abc123def"); + }); + + it("should neutralize all unquoted references when there are more than 10", () => { + const input = Array.from({ length: 11 }, (_, i) => `fixes #${i + 1}`).join(" "); + const result = sanitizeContent(input); + for (let i = 1; i <= 11; i++) { + expect(result).toContain(`\`fixes #${i}\``); + } + }); + + it("should not requote already-quoted entries", () => { + // Build a string with 12 entries where one is already quoted and 11 are unquoted + // (11 unquoted entries exceed the MAX_BOT_TRIGGER_REFERENCES threshold of 10) + const alreadyQuoted = "`fixes #1`"; + const unquoted = Array.from({ length: 11 }, (_, i) => `fixes #${i + 2}`).join(" "); + const input = `${alreadyQuoted} ${unquoted}`; + const result = sanitizeContent(input); + // The already-quoted entry must not be double-quoted + expect(result).not.toContain("``fixes #1``"); + expect(result).toContain("`fixes #1`"); + // The unquoted entries should be wrapped + for (let i = 2; i <= 12; i++) { + expect(result).toContain(`\`fixes #${i}\``); + } }); }); @@ -1063,7 +1087,7 @@ describe("sanitize_content.cjs", () => { expect(result).toContain("https://github.com"); expect(result).not.toContain("