From 099e5c9c59f6cc675180eddec610e5672602f695 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Mon, 3 Mar 2025 16:41:49 +1100 Subject: [PATCH] correct spec and implementation to only bypass reply if not mentioned --- lib/ai_bot/playground.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ai_bot/playground.rb b/lib/ai_bot/playground.rb index 97f803eb5..f9e2fd8e0 100644 --- a/lib/ai_bot/playground.rb +++ b/lib/ai_bot/playground.rb @@ -119,8 +119,10 @@ def self.schedule_reply(post) bot_user ||= User.find_by(id: mentioned[:user_id]) if mentioned end - # in the past we would have an edge case where we would not reply on a mention if it was - # also a reply this just causes confusion + if !mentioned && bot_user && post.reply_to_post_number && !post.reply_to_post.user&.bot? + # replying to a non-bot user + return + end if bot_user topic_persona_id = post.topic.custom_fields["ai_persona_id"]