From 671bc64529df9e019f814852511fb82c5dfab5a1 Mon Sep 17 00:00:00 2001 From: Camol Date: Fri, 9 May 2025 09:43:22 +0800 Subject: [PATCH] fix: display image from mcp response (#5780) --- src/renderer/src/utils/mcp-tools.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/utils/mcp-tools.ts b/src/renderer/src/utils/mcp-tools.ts index 4a8987b143..e8abc2f4bc 100644 --- a/src/renderer/src/utils/mcp-tools.ts +++ b/src/renderer/src/utils/mcp-tools.ts @@ -438,8 +438,8 @@ export async function parseAndCallTools( upsertMCPToolResponse(toolResponses, { id: `${tool.id}-${idx}-${i}`, tool: tool.tool, status: 'invoking' }, onChunk) } - const images: string[] = [] const toolPromises = tools.map(async (tool, i) => { + const images: string[] = [] const toolCallResponse = await callMCPTool(tool.tool) upsertMCPToolResponse( toolResponses, @@ -454,6 +454,9 @@ export async function parseAndCallTools( } if (images.length) { + onChunk({ + type: ChunkType.IMAGE_CREATED + }) onChunk({ type: ChunkType.IMAGE_COMPLETE, image: {