auto-reset conversation history when switching persona

This commit is contained in:
2026-06-17 02:37:59 +02:00
parent 677f3b5d4f
commit 71ccf4d995
+7
View File
@@ -159,6 +159,13 @@ func (p *Plugin) handlePersonaSwitch(args *model.CommandArgs, personaID string)
if err := p.SavePersonaOverride(args.UserId, args.ChannelId, personaID); err != nil {
return p.response("Failed to save persona: " + err.Error()), nil
}
// Auto-reset conversation history so old persona context doesn't bleed.
if p.conversationStore != nil {
p.conversationStore.Reset(args.UserId, args.ChannelId)
}
if p.engagementEngine != nil {
p.engagementEngine.Sleep(args.UserId, args.ChannelId)
}
return p.response("Persona switched to: " + personaID + ". @matty to test."), nil
}