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 {