fix(replies): keep finals for cross-target messaging sends

Co-authored-by: Ion Mudreac <mudreac@gmail.com>
This commit is contained in:
Peter Steinberger
2026-02-22 19:32:06 +01:00
parent 40680432b4
commit 0342bed289
4 changed files with 60 additions and 8 deletions

View File

@@ -876,6 +876,19 @@ describe("runReplyAgent messaging tool suppression", () => {
expect(result).toMatchObject({ text: "hello world!" });
});
it("keeps final reply when text matches a cross-target messaging send", async () => {
runEmbeddedPiAgentMock.mockResolvedValueOnce({
payloads: [{ text: "hello world!" }],
messagingToolSentTexts: ["hello world!"],
messagingToolSentTargets: [{ tool: "discord", provider: "discord", to: "channel:C1" }],
meta: {},
});
const result = await createRun("slack");
expect(result).toMatchObject({ text: "hello world!" });
});
it("delivers replies when account ids do not match", async () => {
runEmbeddedPiAgentMock.mockResolvedValueOnce({
payloads: [{ text: "hello world!" }],