diff --git a/Makefile b/Makefile index e845c9c..96977c5 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ # make clean — Remove build artifacts PLUGIN_ID := com.forkless.mattermore -PLUGIN_VERSION := 0.1.15 +PLUGIN_VERSION := 0.1.16 DIST_DIR := dist SERVER_DIR := server BUNDLE_NAME := $(PLUGIN_ID)-$(PLUGIN_VERSION).tar.gz diff --git a/plugin.json b/plugin.json index e551622..6301779 100644 --- a/plugin.json +++ b/plugin.json @@ -2,7 +2,7 @@ "id": "com.forkless.mattermore", "name": "Matty", "description": "AI chat agent powered by Ollama.", - "version": "0.1.15", + "version": "0.1.16", "min_server_version": "11.6.1", "server": { "executables": { diff --git a/server/hooks.go b/server/hooks.go index e8c3af1..a599722 100644 --- a/server/hooks.go +++ b/server/hooks.go @@ -200,6 +200,10 @@ func (p *Plugin) MessageHasBeenPosted(c *plugin.Context, post *model.Post) { 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 + } systemPrompt := "" if persona != "" { systemPrompt = "You are " + persona + ". Respond in character. Only respond to the latest message — do not re-address earlier messages. Vary your openings and phrasing each time." diff --git a/server/persona.go b/server/persona.go index f8796a3..1bff41c 100644 --- a/server/persona.go +++ b/server/persona.go @@ -24,15 +24,11 @@ var personaLibrary = map[string]string{ "scammer": "a tech support scammer from 2008. Alarmist, pushy, uses ALL CAPS occasionally.", } -// resolvePersona takes a value from the dropdown (stable ID or legacy full text) -// and returns the full persona description. Falls back to the default if unknown. +// resolvePersona takes a persona ID and returns the full description. +// Returns empty string if the ID is unknown. func resolvePersona(value string) string { if p, ok := personaLibrary[value]; ok { return p } - // If it's already a full description (e.g. old saved config), pass through. - if value != "" { - return value - } - return personaLibrary["assistant"] + return "" }