chore: update mention gating docs and tests

This commit is contained in:
Peter Steinberger
2026-01-06 01:38:36 +01:00
parent 811ec8b78b
commit d813e14950
11 changed files with 107 additions and 8 deletions

View File

@@ -139,6 +139,36 @@ describe("monitorIMessageProvider", () => {
expect(replyMock).toHaveBeenCalled();
});
it("allows group messages when requireMention is true but no mentionPatterns exist", async () => {
config = {
...config,
routing: { groupChat: { mentionPatterns: [] }, allowFrom: [] },
imessage: { groups: { "*": { requireMention: true } } },
};
const run = monitorIMessageProvider();
await waitForSubscribe();
notificationHandler?.({
method: "message",
params: {
message: {
id: 12,
chat_id: 777,
sender: "+15550001111",
is_from_me: false,
text: "hello group",
is_group: true,
},
},
});
await flush();
closeResolve?.();
await run;
expect(replyMock).toHaveBeenCalled();
});
it("prefixes tool and final replies with responsePrefix", async () => {
config = {
...config,