缺陷 / 严重 / LLM 适配器
electron/harness/adapters/ollama.adapter.ts
当用户上传图片或 LLM 调用涉及图片消息时,MetonaMessage.images 中可能存储的是 http(s) URL。 当前 Ollama Adapter 的多模态处理直接将 URL 当作 base64 字符串塞入 images: [url] 字段传给 Ollama。 Ollama 无法识别该格式,会抛出 base64 解码错误或返回空响应。
images: [url]
参考 Agnes AI Adapter 实现:
async function resolveImageToBase64(image: string): Promise<string> { if (image.startsWith('http')) { const res = await fetch(image); const buf = Buffer.from(await res.arrayBuffer()); return `data:${res.headers.get('content-type') ?? 'image/png'};base64,${buf.toString('base64')}`; } return image; }
No dependencies set.
The note is not visible to the blocked user.
问题类型
缺陷 / 严重 / LLM 适配器
文件位置
electron/harness/adapters/ollama.adapter.ts问题描述
当用户上传图片或 LLM 调用涉及图片消息时,MetonaMessage.images 中可能存储的是 http(s) URL。
当前 Ollama Adapter 的多模态处理直接将 URL 当作 base64 字符串塞入
images: [url]字段传给 Ollama。Ollama 无法识别该格式,会抛出 base64 解码错误或返回空响应。
影响
建议修复
参考 Agnes AI Adapter 实现: