Fix (race): mutex chatbody
This commit is contained in:
4
tools.go
4
tools.go
@@ -1215,11 +1215,11 @@ func isCommandAllowed(command string, args ...string) bool {
|
||||
}
|
||||
|
||||
func summarizeChat(args map[string]string) []byte {
|
||||
if len(chatBody.Messages) == 0 {
|
||||
if chatBody.GetMessageCount() == 0 {
|
||||
return []byte("No chat history to summarize.")
|
||||
}
|
||||
// Format chat history for the agent
|
||||
chatText := chatToText(chatBody.Messages, true) // include system and tool messages
|
||||
chatText := chatToText(chatBody.GetMessages(), true) // include system and tool messages
|
||||
return []byte(chatText)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user