fix: harden iMessage echo dedupe and reasoning suppression (#25897)

This commit is contained in:
Peter Steinberger
2026-02-25 00:43:44 +00:00
parent a9ce6bd79b
commit 2a11c09a8d
13 changed files with 273 additions and 40 deletions

View File

@@ -35,4 +35,16 @@ describe("extractMessagingToolSend", () => {
expect(result?.provider).toBe("slack");
expect(result?.to).toBe("channel:C1");
});
it("accepts target alias when to is omitted", () => {
const result = extractMessagingToolSend("message", {
action: "send",
channel: "telegram",
target: "123",
});
expect(result?.tool).toBe("message");
expect(result?.provider).toBe("telegram");
expect(result?.to).toBe("telegram:123");
});
});

View File

@@ -298,7 +298,12 @@ export function extractMessagingToolSend(
if (action !== "send" && action !== "thread-reply") {
return undefined;
}
const toRaw = typeof args.to === "string" ? args.to : undefined;
const toRaw =
typeof args.to === "string"
? args.to
: typeof args.target === "string"
? args.target
: undefined;
if (!toRaw) {
return undefined;
}