mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 03:34:33 +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:
@@ -3,6 +3,7 @@ import { dispatchChannelMessageAction } from "../../channels/plugins/message-act
|
||||
import type { ChannelId, ChannelThreadingToolContext } from "../../channels/plugins/types.js";
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import { appendAssistantMessageToSessionTranscript } from "../../config/sessions.js";
|
||||
import { getAgentScopedMediaLocalRoots } from "../../media/local-roots.js";
|
||||
import type { GatewayClientMode, GatewayClientName } from "../../utils/message-channel.js";
|
||||
import { throwIfAborted } from "./abort.js";
|
||||
import type { OutboundSendDeps } from "./deliver.js";
|
||||
@@ -54,11 +55,16 @@ async function tryHandleWithPluginAction(params: {
|
||||
if (params.ctx.dryRun) {
|
||||
return null;
|
||||
}
|
||||
const mediaLocalRoots = getAgentScopedMediaLocalRoots(
|
||||
params.ctx.cfg,
|
||||
params.ctx.agentId ?? params.ctx.mirror?.agentId,
|
||||
);
|
||||
const handled = await dispatchChannelMessageAction({
|
||||
channel: params.ctx.channel,
|
||||
action: params.action,
|
||||
cfg: params.ctx.cfg,
|
||||
params: params.ctx.params,
|
||||
mediaLocalRoots,
|
||||
accountId: params.ctx.accountId ?? undefined,
|
||||
gateway: params.ctx.gateway,
|
||||
toolContext: params.ctx.toolContext,
|
||||
|
||||
Reference in New Issue
Block a user