

























@@ -325,5 +325,49 @@ describe("thread-ownership plugin", () => {
325325expect(result).toBeUndefined();
326326expect(globalThis.fetch).not.toHaveBeenCalled();
327327});
328+329+it("does not treat superset handles as agent-name mentions", async () => {
330+await hooks.message_received(
331+{
332+content: "hey @testbot2 help",
333+threadId: "8888.0003",
334+metadata: { channelId: "C789" },
335+},
336+{ channelId: "slack", conversationId: "C789" },
337+);
338+339+vi.mocked(globalThis.fetch).mockResolvedValue(
340+new Response(JSON.stringify({ owner: "test-agent" }), { status: 200 }),
341+);
342+343+await hooks.message_sending(
344+{ content: "On it!", replyToId: "8888.0003", metadata: { channelId: "C789" }, to: "C789" },
345+{ channelId: "slack", conversationId: "C789" },
346+);
347+348+expect(globalThis.fetch).toHaveBeenCalled();
349+});
350+351+it("does not treat email-like text as an agent-name mention", async () => {
352+await hooks.message_received(
353+{
354+content: "send mail to foo@testbot.com",
355+threadId: "8888.0004",
356+metadata: { channelId: "C789" },
357+},
358+{ channelId: "slack", conversationId: "C789" },
359+);
360+361+vi.mocked(globalThis.fetch).mockResolvedValue(
362+new Response(JSON.stringify({ owner: "test-agent" }), { status: 200 }),
363+);
364+365+await hooks.message_sending(
366+{ content: "On it!", replyToId: "8888.0004", metadata: { channelId: "C789" }, to: "C789" },
367+{ channelId: "slack", conversationId: "C789" },
368+);
369+370+expect(globalThis.fetch).toHaveBeenCalled();
371+});
328372});
329373});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。