Fix (race): mutex chatbody

This commit is contained in:
Grail Finder
2026-03-07 10:46:18 +03:00
parent 014e297ae3
commit a842b00e96
9 changed files with 422 additions and 142 deletions

View File

@@ -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)
}