mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-31 22:32:28 +00:00
fix: adjust resolve parts so that when messages with multiple @ references occur, the tool calls are properly ordered
This commit is contained in:
@@ -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,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user