mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
if finish reason is unknown, continue
This commit is contained in:
parent
d6cdd24fad
commit
00f991162f
1 changed files with 5 additions and 1 deletions
|
|
@ -265,7 +265,11 @@ export namespace SessionPrompt {
|
|||
}
|
||||
|
||||
if (!lastUser) throw new Error("No user message found in stream. This should never happen.")
|
||||
if (lastAssistant?.finish && lastAssistant.finish !== "tool-calls" && lastUser.id < lastAssistant.id) {
|
||||
if (
|
||||
lastAssistant?.finish &&
|
||||
!["tool-calls", "unknown"].includes(lastAssistant.finish) &&
|
||||
lastUser.id < lastAssistant.id
|
||||
) {
|
||||
log.info("exiting loop", { sessionID })
|
||||
break
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue