Просмотр исходного кода

fix: add missing id/sessionID/messageID to MCP tool attachments (#14345)

NatChung 2 месяцев назад
Родитель
Сommit
d2d7a37bca
1 измененных файлов с 6 добавлено и 1 удалено
  1. 6 1
      packages/opencode/src/session/prompt.ts

+ 6 - 1
packages/opencode/src/session/prompt.ts

@@ -906,7 +906,12 @@ export namespace SessionPrompt {
           title: "",
           metadata,
           output: truncated.content,
-          attachments,
+          attachments: attachments.map((attachment) => ({
+            ...attachment,
+            id: Identifier.ascending("part"),
+            sessionID: ctx.sessionID,
+            messageID: input.processor.message.id,
+          })),
           content: result.content, // directly return content to preserve ordering when outputting to model
         }
       }