v0.1.17: replace persona library with juxtaposed characters, add custom persona support

This commit is contained in:
2026-06-17 00:13:52 +02:00
parent 4a212c160c
commit 11bc5c44af
9 changed files with 125 additions and 58 deletions
+12 -9
View File
@@ -191,18 +191,21 @@ func (p *Plugin) MessageHasBeenPosted(c *plugin.Context, post *model.Post) {
}
// Prepend the persona system prompt to set the bot's character.
// Priority: KV override > CustomPersona config > Persona dropdown config
// Priority: KV override > dropdown selection
// If dropdown = "custom" → use CustomPersona textarea field
// Otherwise → resolve from personaLibrary
persona := p.GetPersonaOverride(post.UserId, post.ChannelId)
persona = resolvePersona(persona)
if persona == "" {
persona = cfg.CustomPersona
}
if persona == "" {
persona = resolvePersona(cfg.Persona)
}
// If still empty and the config has a value, use it as-is (legacy fallback).
if persona == "" && cfg.Persona != "" {
persona = cfg.Persona
if cfg.Persona == "custom" {
persona = cfg.CustomPersona
} else {
persona = resolvePersona(cfg.Persona)
// If resolvePersona returned empty but a value was set, use it as-is (legacy fallback).
if persona == "" && cfg.Persona != "" {
persona = cfg.Persona
}
}
}
systemPrompt := ""
if persona != "" {