mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 02:34:32 +00:00
fix(media): enforce agent media roots in plugin send actions
Co-authored-by: Oliver Drobnik <333270+odrobnik@users.noreply.github.com> Co-authored-by: thisischappy <257418353+thisischappy@users.noreply.github.com>
This commit is contained in:
@@ -264,6 +264,28 @@ describe("handleDiscordMessagingAction", () => {
|
||||
expect(sendMessageDiscord).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("forwards trusted mediaLocalRoots into sendMessageDiscord", async () => {
|
||||
sendMessageDiscord.mockClear();
|
||||
await handleDiscordMessagingAction(
|
||||
"sendMessage",
|
||||
{
|
||||
to: "channel:123",
|
||||
content: "hello",
|
||||
mediaUrl: "/tmp/image.png",
|
||||
},
|
||||
enableAllActions,
|
||||
{ mediaLocalRoots: ["/tmp/agent-root"] },
|
||||
);
|
||||
expect(sendMessageDiscord).toHaveBeenCalledWith(
|
||||
"channel:123",
|
||||
"hello",
|
||||
expect.objectContaining({
|
||||
mediaUrl: "/tmp/image.png",
|
||||
mediaLocalRoots: ["/tmp/agent-root"],
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("rejects voice messages that include content", async () => {
|
||||
await expect(
|
||||
handleDiscordMessagingAction(
|
||||
|
||||
Reference in New Issue
Block a user