From 98a5e287efe1e9b141f37732af849a1a78b4e14e Mon Sep 17 00:00:00 2001 From: amit221 <6964675+amit221@users.noreply.github.com> Date: Tue, 24 Mar 2026 15:29:28 +0200 Subject: [PATCH] test(issues): document Greptile mid-token case vs old strip behavior Made-with: Cursor --- .../src/__tests__/normalize-agent-mention-token.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/src/__tests__/normalize-agent-mention-token.test.ts b/server/src/__tests__/normalize-agent-mention-token.test.ts index fcbf4c2f..6b41de87 100644 --- a/server/src/__tests__/normalize-agent-mention-token.test.ts +++ b/server/src/__tests__/normalize-agent-mention-token.test.ts @@ -14,8 +14,12 @@ describe("normalizeAgentMentionToken", () => { expect(normalizeAgentMentionToken("Baba ")).toBe("Baba"); }); - // Greptile: entity mid-token (not only trailing) — must decode & to &, not delete the sequence. - it("decodes & in the middle of a mention token", () => { + /** + * Greptile (PR review): cover an entity in the *middle* of a token, not only trailing ` ` / ` `. + * Earlier implementation *stripped* `&`, turning `Ba&ba` into `Baba` and breaking names like `M&M`. + * Current behavior decodes `&` → `&`, so the expected value is `Ba&ba`, not `Baba`. + */ + it("decodes a named entity mid-token (Ba&ba → Ba&ba, not strip to Baba)", () => { expect(normalizeAgentMentionToken("Ba&ba")).toBe("Ba&ba"); });