fix(mentions): check mentionPatterns even when explicit mention is available

This commit is contained in:
HirokiKobayashi-R authored and Ayaan Zaidi committed 2026-01-29 10:31:47 +05:30
1 parent fcc53bcf1b
commit 22b59d24ce
5 files changed
+26 -10

No files matched your search

@@ -135,7 +135,7 @@ describe("discord tool result dispatch", () => {
expect(sendMock).toHaveBeenCalledTimes(1);
}, 20_000);
it("skips guild messages when another user is explicitly mentioned", async () => {
it("accepts guild messages when mentionPatterns match even if another user is mentioned", async () => {
const { createDiscordMessageHandler } = await import("./monitor.js");
const cfg = {
agents: {
@@ -211,8 +211,8 @@ describe("discord tool result dispatch", () => {
client,
);
expect(dispatchMock).not.toHaveBeenCalled();
expect(sendMock).not.toHaveBeenCalled();
expect(dispatchMock).toHaveBeenCalledTimes(1);
expect(sendMock).toHaveBeenCalledTimes(1);
}, 20_000);
it("accepts guild reply-to-bot messages as implicit mentions", async () => {