mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 00:31:24 +00:00
fix: harden iMessage echo dedupe and reasoning suppression (#25897)
This commit is contained in:
@@ -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");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user