mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 19:08:27 +00:00
fix: allow agent workspace directories in media local roots (#17136)
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 7545ef1e19
Co-authored-by: MisterGuy420 <255743668+MisterGuy420@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
This commit is contained in:
@@ -85,6 +85,7 @@ describe("deliverWebReply", () => {
|
||||
|
||||
it("sends image media with caption and then remaining text", async () => {
|
||||
const msg = makeMsg();
|
||||
const mediaLocalRoots = ["/tmp/workspace-work"];
|
||||
(
|
||||
loadWebMedia as unknown as { mockResolvedValueOnce: (v: unknown) => void }
|
||||
).mockResolvedValueOnce({
|
||||
@@ -96,12 +97,18 @@ describe("deliverWebReply", () => {
|
||||
await deliverWebReply({
|
||||
replyResult: { text: "aaaaaa", mediaUrl: "http://example.com/img.jpg" },
|
||||
msg,
|
||||
mediaLocalRoots,
|
||||
maxMediaBytes: 1024 * 1024,
|
||||
textLimit: 3,
|
||||
replyLogger,
|
||||
skipLog: true,
|
||||
});
|
||||
|
||||
expect(loadWebMedia).toHaveBeenCalledWith("http://example.com/img.jpg", {
|
||||
maxBytes: 1024 * 1024,
|
||||
localRoots: mediaLocalRoots,
|
||||
});
|
||||
|
||||
expect(msg.sendMedia).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
image: expect.any(Buffer),
|
||||
|
||||
Reference in New Issue
Block a user