From b3cec4f4ccb995a9438a95a1cecab213caa3ff7e Mon Sep 17 00:00:00 2001 From: Fork Less Date: Wed, 17 Jun 2026 02:07:15 +0200 Subject: [PATCH] fix: log /ai new errors instead of showing user Failed to reset conversation --- server/command.go | 2 +- server/store.go | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/server/command.go b/server/command.go index 79a8b09..5cb0dd3 100644 --- a/server/command.go +++ b/server/command.go @@ -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 diff --git a/server/store.go b/server/store.go index 00ea439..f38cec4 100644 --- a/server/store.go +++ b/server/store.go @@ -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 {