mirror of
https://github.com/sst/opencode.git
synced 2025-08-31 10:17:26 +00:00
aborted toolcalls should be cleaned up
This commit is contained in:
parent
fed659c582
commit
fdaa7f287c
1 changed files with 12 additions and 0 deletions
|
@ -564,6 +564,18 @@ export namespace Session {
|
|||
},
|
||||
})
|
||||
next.metadata!.time.completed = Date.now()
|
||||
for (const part of next.parts) {
|
||||
if (
|
||||
part.type === "tool-invocation" &&
|
||||
part.toolInvocation.state !== "result"
|
||||
) {
|
||||
part.toolInvocation = {
|
||||
...part.toolInvocation,
|
||||
state: "result",
|
||||
result: "request was aborted",
|
||||
}
|
||||
}
|
||||
}
|
||||
await updateMessage(next)
|
||||
return next
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue