Feat: rename user through props

This commit is contained in:
Grail Finder
2025-06-11 11:36:24 +03:00
parent 8902893f6e
commit c2da07ddc3
6 changed files with 139 additions and 81 deletions

2
bot.go
View File

@@ -437,6 +437,7 @@ func removeThinking(chatBody *models.ChatBody) {
func applyCharCard(cc *models.CharCard) {
cfg.AssistantRole = cc.Role
// FIXME: remove
// Initialize Cluedo if enabled and matching role
if cfg.EnableCluedo && cc.Role == "CluedoPlayer" {
playerOrder = []string{cfg.UserRole, cfg.AssistantRole, cfg.CluedoRole2}
@@ -444,6 +445,7 @@ func applyCharCard(cc *models.CharCard) {
}
history, err := loadAgentsLastChat(cfg.AssistantRole)
if err != nil {
// TODO: too much action for err != nil; loadAgentsLastChat needs to be split up
logger.Warn("failed to load last agent chat;", "agent", cc.Role, "err", err)
history = []models.RoleMsg{
{Role: "system", Content: cc.SysPrompt},