mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 04:13:44 +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:
@@ -243,6 +243,23 @@ describe("handleTelegramAction", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("forwards trusted mediaLocalRoots into sendMessageTelegram", async () => {
|
||||
await handleTelegramAction(
|
||||
{
|
||||
action: "sendMessage",
|
||||
to: "@testchannel",
|
||||
content: "Hello with local media",
|
||||
},
|
||||
telegramConfig(),
|
||||
{ mediaLocalRoots: ["/tmp/agent-root"] },
|
||||
);
|
||||
expect(sendMessageTelegram).toHaveBeenCalledWith(
|
||||
"@testchannel",
|
||||
"Hello with local media",
|
||||
expect.objectContaining({ mediaLocalRoots: ["/tmp/agent-root"] }),
|
||||
);
|
||||
});
|
||||
|
||||
it.each([
|
||||
{
|
||||
name: "media",
|
||||
|
||||
Reference in New Issue
Block a user