mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 01:48:28 +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:
@@ -34,6 +34,7 @@ import { finalizeInboundContext } from "../../auto-reply/reply/inbound-context.j
|
||||
import { dispatchReplyWithDispatcher } from "../../auto-reply/reply/provider-dispatcher.js";
|
||||
import { resolveCommandAuthorizedFromAuthorizers } from "../../channels/command-gating.js";
|
||||
import { createReplyPrefixOptions } from "../../channels/reply-prefix.js";
|
||||
import { getAgentScopedMediaLocalRoots } from "../../media/local-roots.js";
|
||||
import { buildPairingReply } from "../../pairing/pairing-messages.js";
|
||||
import {
|
||||
readChannelAllowFromStore,
|
||||
@@ -814,6 +815,7 @@ async function dispatchDiscordCommandInteraction(params: {
|
||||
channel: "discord",
|
||||
accountId: route.accountId,
|
||||
});
|
||||
const mediaLocalRoots = getAgentScopedMediaLocalRoots(cfg, route.agentId);
|
||||
|
||||
let didReply = false;
|
||||
await dispatchReplyWithDispatcher({
|
||||
@@ -827,6 +829,7 @@ async function dispatchDiscordCommandInteraction(params: {
|
||||
await deliverDiscordInteractionReply({
|
||||
interaction,
|
||||
payload,
|
||||
mediaLocalRoots,
|
||||
textLimit: resolveTextChunkLimit(cfg, "discord", accountId, {
|
||||
fallbackLimit: 2000,
|
||||
}),
|
||||
@@ -861,6 +864,7 @@ async function dispatchDiscordCommandInteraction(params: {
|
||||
async function deliverDiscordInteractionReply(params: {
|
||||
interaction: CommandInteraction | ButtonInteraction;
|
||||
payload: ReplyPayload;
|
||||
mediaLocalRoots?: readonly string[];
|
||||
textLimit: number;
|
||||
maxLinesPerMessage?: number;
|
||||
preferFollowUp: boolean;
|
||||
@@ -899,7 +903,9 @@ async function deliverDiscordInteractionReply(params: {
|
||||
if (mediaList.length > 0) {
|
||||
const media = await Promise.all(
|
||||
mediaList.map(async (url) => {
|
||||
const loaded = await loadWebMedia(url);
|
||||
const loaded = await loadWebMedia(url, {
|
||||
localRoots: params.mediaLocalRoots,
|
||||
});
|
||||
return {
|
||||
name: loaded.fileName ?? "upload",
|
||||
data: loaded.buffer,
|
||||
|
||||
Reference in New Issue
Block a user