summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bot.go6
-rw-r--r--tui.go1
2 files changed, 6 insertions, 1 deletions
diff --git a/bot.go b/bot.go
index 2c1689f..5d9cf03 100644
--- a/bot.go
+++ b/bot.go
@@ -745,7 +745,7 @@ func sendMsgToLLM(body io.Reader) {
}
interrupt:
if interruptResp { // read bytes, so it would not get into beginning of the next req
- interruptResp = false
+ // interruptResp = false
logger.Info("interrupted bot response", "chunk_counter", counter)
streamDone <- true
break
@@ -799,6 +799,7 @@ func showSpinner() {
}
func chatRound(r *models.ChatRoundReq) error {
+ interruptResp = false
botRespMode = true
go showSpinner()
updateStatusLine()
@@ -964,6 +965,9 @@ out:
}
// Strip think blocks before parsing for tool calls
respTextNoThink := thinkBlockRE.ReplaceAllString(respText.String(), "")
+ if interruptResp {
+ return nil
+ }
if findCall(respTextNoThink, toolResp.String()) {
return nil
}
diff --git a/tui.go b/tui.go
index 366f466..eb1b165 100644
--- a/tui.go
+++ b/tui.go
@@ -726,6 +726,7 @@ func init() {
if event.Key() == tcell.KeyF6 {
interruptResp = true
botRespMode = false
+ toolRunningMode = false
return nil
}
if event.Key() == tcell.KeyF7 {