summaryrefslogtreecommitdiff
path: root/bot.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2026-01-17 11:54:52 +0300
committerGrail Finder <wohilas@gmail.com>2026-01-17 11:54:52 +0300
commitec2d1c05ace9905e0ff88e25d5d65f0d7ff58274 (patch)
tree29c21b6288e4fa970517ace9f86ac8b0d27d4863 /bot.go
parent8b162ef34f0755e2224c43499218def16d4b6845 (diff)
Fix: do not skip system msgs
Diffstat (limited to 'bot.go')
-rw-r--r--bot.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/bot.go b/bot.go
index a5d3b12..fc878d5 100644
--- a/bot.go
+++ b/bot.go
@@ -95,7 +95,6 @@ func parseKnownToTag(content string) (string, []string) {
}
// Remove the entire matched tag from content
cleaned = strings.Replace(cleaned, match[0], "", 1)
-
list := strings.TrimSpace(match[1])
if list == "" {
continue
@@ -122,6 +121,7 @@ func processMessageTag(msg models.RoleMsg) models.RoleMsg {
// If KnownTo already set, assume tag already processed (content cleaned).
// However, we still check for new tags (maybe added later).
cleaned, knownTo := parseKnownToTag(msg.Content)
+ logger.Info("processing tags", "msg", msg.Content, "known_to", knownTo)
if cleaned != msg.Content {
msg.Content = cleaned
}
@@ -156,7 +156,8 @@ func filterMessagesForCharacter(messages []models.RoleMsg, character string) []m
for i, msg := range messages {
logger.Info("filtering messages", "character", character, "index", i, "known_to", msg.KnownTo)
// If KnownTo is nil or empty, message is visible to all
- if len(msg.KnownTo) == 0 {
+ // system msg cannot be filtered
+ if len(msg.KnownTo) == 0 || msg.Role == "system" {
filtered = append(filtered, msg)
continue
}