fix: adjust resolve parts so that when messages with multiple @ references occur, the tool calls are properly ordered

This commit is contained in:
Aiden Cline
2026-01-30 15:55:00 -06:00
committed by Dax Raad
parent cb6ec0a564
commit 612b656d36
5 changed files with 60 additions and 33 deletions

View File

@@ -77,6 +77,12 @@ export const BatchTool = Tool.define("batch", async () => {
})
const result = await tool.execute(validatedParams, { ...ctx, callID: partID })
const attachments = result.attachments?.map((attachment) => ({
...attachment,
id: Identifier.ascending("part"),
messageID: ctx.messageID,
sessionID: ctx.sessionID,
}))
await Session.updatePart({
id: partID,
@@ -91,7 +97,7 @@ export const BatchTool = Tool.define("batch", async () => {
output: result.output,
title: result.title,
metadata: result.metadata,
attachments: result.attachments,
attachments,
time: {
start: callStartTime,
end: Date.now(),