tweak: drop ids from attachments in tools, assign them in prompt.ts instead (#13890)

This commit is contained in:
Aiden Cline
2026-02-16 14:59:57 -06:00
committed by GitHub
parent 9d3c81a683
commit a580fb47d2
7 changed files with 37 additions and 20 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"),
sessionID: ctx.sessionID,
messageID: ctx.messageID,
}))
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(),