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

commit-history
NatChung 2026-02-20 08:26:29 +08:00 committed by GitHub
parent f73698b8fc
commit c9008b36c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 1 deletions

View File

@ -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
}
}