fix: Perform snapshot in cases finish-step is not reached (#5912)
Co-authored-by: noamzbr <noamzbr@users.noreply.github.com>
This commit is contained in:
parent
4f73d58031
commit
d4b7f75ce3
1 changed files with 14 additions and 0 deletions
|
|
@ -365,6 +365,20 @@ export namespace SessionProcessor {
|
||||||
error: input.assistantMessage.error,
|
error: input.assistantMessage.error,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (snapshot) {
|
||||||
|
const patch = await Snapshot.patch(snapshot)
|
||||||
|
if (patch.files.length) {
|
||||||
|
await Session.updatePart({
|
||||||
|
id: Identifier.ascending("part"),
|
||||||
|
messageID: input.assistantMessage.id,
|
||||||
|
sessionID: input.sessionID,
|
||||||
|
type: "patch",
|
||||||
|
hash: patch.hash,
|
||||||
|
files: patch.files,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
snapshot = undefined
|
||||||
|
}
|
||||||
const p = await MessageV2.parts(input.assistantMessage.id)
|
const p = await MessageV2.parts(input.assistantMessage.id)
|
||||||
for (const part of p) {
|
for (const part of p) {
|
||||||
if (part.type === "tool" && part.state.status !== "completed" && part.state.status !== "error") {
|
if (part.type === "tool" && part.state.status !== "completed" && part.state.status !== "error") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue