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

@@ -172,6 +172,14 @@ export namespace SessionProcessor {
case "tool-result": {
const match = toolcalls[value.toolCallId]
if (match && match.state.status === "running") {
const attachments = value.output.attachments?.map(
(attachment: Omit<MessageV2.FilePart, "id" | "messageID" | "sessionID">) => ({
...attachment,
id: Identifier.ascending("part"),
messageID: match.messageID,
sessionID: match.sessionID,
}),
)
await Session.updatePart({
...match,
state: {
@@ -184,7 +192,7 @@ export namespace SessionProcessor {
start: match.state.time.start,
end: Date.now(),
},
attachments: value.output.attachments,
attachments,
},
})