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:
Peter Steinberger
2026-02-22 21:17:09 +01:00
parent 33a43a151d
commit 7bbd597383
13 changed files with 193 additions and 10 deletions

View File

@@ -85,6 +85,9 @@ export function readTelegramButtons(
export async function handleTelegramAction(
params: Record<string, unknown>,
cfg: OpenClawConfig,
options?: {
mediaLocalRoots?: readonly string[];
},
): Promise<AgentToolResult<unknown>> {
const action = readStringParam(params, "action", { required: true });
const accountId = readStringParam(params, "accountId");
@@ -198,6 +201,7 @@ export async function handleTelegramAction(
token,
accountId: accountId ?? undefined,
mediaUrl: mediaUrl || undefined,
mediaLocalRoots: options?.mediaLocalRoots,
buttons,
replyToMessageId: replyToMessageId ?? undefined,
messageThreadId: messageThreadId ?? undefined,