summaryrefslogtreecommitdiff
path: root/bot.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2026-03-16 08:38:48 +0300
committerGrail Finder <wohilas@gmail.com>2026-03-16 08:38:48 +0300
commitdf04d8c21c4d256ade69f53bfe171f066db943cc (patch)
tree021f0e039e7e65da3571946e5a2d997b893b4568 /bot.go
parent7c8697f48e3a7729a5aa4ecc5c189bf151070915 (diff)
Fix: wait for the tool resp
Diffstat (limited to 'bot.go')
-rw-r--r--bot.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/bot.go b/bot.go
index d5ce7c6..4f5e6cf 100644
--- a/bot.go
+++ b/bot.go
@@ -1064,14 +1064,7 @@ out:
cleanChatBody()
refreshChatDisplay()
updateStatusLine()
- if cfg.CLIMode && cliRespDone != nil {
- select {
- case cliRespDone <- true:
- default:
- }
- }
- // bot msg is done;
- // now check it for func call
+ // bot msg is done; now check it for func call
// logChat(activeChatName, chatBody.Messages)
if err := updateStorageChat(activeChatName, chatBody.Messages); err != nil {
logger.Warn("failed to update storage", "error", err, "name", activeChatName)
@@ -1082,8 +1075,16 @@ out:
return nil
}
if findCall(respTextNoThink, toolResp.String()) {
+ // Tool was found and executed, subsequent chatRound will signal cliRespDone when complete
return nil
}
+ // No tool call - signal completion now
+ if cfg.CLIMode && cliRespDone != nil {
+ select {
+ case cliRespDone <- true:
+ default:
+ }
+ }
// Check if this message was sent privately to specific characters
// If so, trigger those characters to respond if that char is not controlled by user
// perhaps we should have narrator role to determine which char is next to act