Enha: consolidate assistant messages only

This commit is contained in:
Grail Finder
2026-02-02 08:18:49 +03:00
parent c1b04303ef
commit e52e8ce2cc
2 changed files with 16 additions and 19 deletions

4
bot.go
View File

@@ -195,8 +195,8 @@ func consolidateAssistantMessages(messages []models.RoleMsg) []models.RoleMsg {
isBuildingAssistantMsg := false
for i := 0; i < len(messages); i++ {
msg := messages[i]
// what about the case with multiplpe assistant roles?
if msg.Role == cfg.AssistantRole || msg.Role == cfg.WriteNextMsgAsCompletionAgent {
// assistant role only
if msg.Role == cfg.AssistantRole {
// If this is an assistant message, start or continue building
if !isBuildingAssistantMsg {
// Start accumulating assistant message