fix(agent): resolve image path from mediaId for IM channel multimodal injection

This commit is contained in:
matevip 2026-04-06 10:57:34 +08:00
parent af40fbd7de
commit 91cd03c0da

View File

@ -285,11 +285,14 @@ public abstract class BaseAgent {
continue;
}
// 解析媒体文件路径先尝试原始 path再尝试拼接工作目录
// 解析媒体文件路径先尝试 path再尝试 mediaIdIM 渠道下载后存在 mediaId 拼接工作目录
Path mediaPath = resolveImagePath(part.getPath());
if (mediaPath == null && part.getMediaId() != null) {
mediaPath = resolveImagePath(part.getMediaId());
}
if (mediaPath == null) {
log.warn("[{}] {} file not found for attachment: {}, path: {}",
agentName, isVideo ? "Video" : "Image", part.getFileName(), part.getPath());
log.warn("[{}] {} file not found for attachment: {}, path: {}, mediaId: {}",
agentName, isVideo ? "Video" : "Image", part.getFileName(), part.getPath(), part.getMediaId());
continue;
}
try {