fix: log /ai new errors instead of showing user Failed to reset conversation

This commit is contained in:
2026-06-17 02:07:15 +02:00
parent e6885f7db9
commit b3cec4f4cc
2 changed files with 2 additions and 4 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ func (p *Plugin) ExecuteCommand(_ *plugin.Context, args *model.CommandArgs) (*mo
case parts[0] == "new":
if err := p.conversationStore.Reset(args.UserId, args.ChannelId); err != nil {
return p.response("Failed to reset conversation."), nil
p.API.LogError("Failed to reset conversation", "error", err.Error())
}
p.engagementEngine.Sleep(args.UserId, args.ChannelId)
return p.response("Conversation reset. @matty to start again."), nil
+1 -3
View File
@@ -86,9 +86,7 @@ func (s *ConversationStore) BuildMessages(userID, channelID, prompt string) ([]C
func (s *ConversationStore) Reset(userID, channelID string) error {
s.mu.Lock()
defer s.mu.Unlock()
// Ignore errors — the key may not exist, and an empty session is the goal either way.
_ = s.api.KVDelete(sessionKey(userID, channelID))
return nil
return s.api.KVDelete(sessionKey(userID, channelID))
}
func (s *ConversationStore) loadSession(userID, channelID string) *conversationSession {