Fix: wait for the tool resp
This commit is contained in:
17
bot.go
17
bot.go
@@ -1064,14 +1064,7 @@ out:
|
|||||||
cleanChatBody()
|
cleanChatBody()
|
||||||
refreshChatDisplay()
|
refreshChatDisplay()
|
||||||
updateStatusLine()
|
updateStatusLine()
|
||||||
if cfg.CLIMode && cliRespDone != nil {
|
// bot msg is done; now check it for func call
|
||||||
select {
|
|
||||||
case cliRespDone <- true:
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// bot msg is done;
|
|
||||||
// now check it for func call
|
|
||||||
// logChat(activeChatName, chatBody.Messages)
|
// logChat(activeChatName, chatBody.Messages)
|
||||||
if err := updateStorageChat(activeChatName, chatBody.Messages); err != nil {
|
if err := updateStorageChat(activeChatName, chatBody.Messages); err != nil {
|
||||||
logger.Warn("failed to update storage", "error", err, "name", activeChatName)
|
logger.Warn("failed to update storage", "error", err, "name", activeChatName)
|
||||||
@@ -1082,8 +1075,16 @@ out:
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if findCall(respTextNoThink, toolResp.String()) {
|
if findCall(respTextNoThink, toolResp.String()) {
|
||||||
|
// Tool was found and executed, subsequent chatRound will signal cliRespDone when complete
|
||||||
return nil
|
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
|
// 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
|
// 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
|
// perhaps we should have narrator role to determine which char is next to act
|
||||||
|
|||||||
0
cli-tests/sort-text/setup.sh
Normal file → Executable file
0
cli-tests/sort-text/setup.sh
Normal file → Executable file
Reference in New Issue
Block a user