From 2060426709bd33a198a4c20d309dbe3934495282 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 24 Apr 2025 21:31:14 +1100 Subject: [PATCH] FIX: guard against situations where there is no reply, pass thread id (#1279) --- lib/ai_bot/chat_streamer.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ai_bot/chat_streamer.rb b/lib/ai_bot/chat_streamer.rb index 478301ac..bd441e7c 100644 --- a/lib/ai_bot/chat_streamer.rb +++ b/lib/ai_bot/chat_streamer.rb @@ -62,6 +62,7 @@ module DiscourseAi ChatSDK::Message.create( raw: message, channel_id: channel.id, + thread_id: thread_id, guardian: guardian, force_thread: force_thread, in_reply_to_id: in_reply_to_id, @@ -78,7 +79,7 @@ module DiscourseAi def done @queue << :done @worker_thread.join - ChatSDK::Message.stop_stream(message_id: @reply.id, guardian: @guardian) + ChatSDK::Message.stop_stream(message_id: @reply.id, guardian: @guardian) if @reply @reply end