fix: honor send path/filePath inputs (#1444) (thanks @hopyky)

This commit is contained in:
Peter Steinberger
2026-01-23 02:10:05 +00:00
parent 59a8eecd7e
commit 837749dced
4 changed files with 60 additions and 10 deletions

View File

@@ -341,15 +341,6 @@ export function createMessageTool(options?: MessageToolOptions): AnyAgentTool {
required: true,
}) as ChannelMessageActionName;
// Handle path and filePath parameters: convert to media with file:// URL
if (action === "send" && !params.media) {
const filePath =
(params.path as string | undefined) || (params.filePath as string | undefined);
if (filePath) {
params.media = filePath.startsWith("file://") ? filePath : `file://${filePath}`;
}
}
const accountId = readStringParam(params, "accountId") ?? agentAccountId;
const gateway = {