auto-reset conversation history when switching persona
This commit is contained in:
@@ -159,6 +159,13 @@ func (p *Plugin) handlePersonaSwitch(args *model.CommandArgs, personaID string)
|
|||||||
if err := p.SavePersonaOverride(args.UserId, args.ChannelId, personaID); err != nil {
|
if err := p.SavePersonaOverride(args.UserId, args.ChannelId, personaID); err != nil {
|
||||||
return p.response("Failed to save persona: " + err.Error()), 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
|
return p.response("Persona switched to: " + personaID + ". @matty to test."), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user