Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 2060426

Browse files
authored
FIX: guard against situations where there is no reply, pass thread id (#1279)
1 parent 2a5c60d commit 2060426

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/ai_bot/chat_streamer.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def create_reply(message)
6262
ChatSDK::Message.create(
6363
raw: message,
6464
channel_id: channel.id,
65+
thread_id: thread_id,
6566
guardian: guardian,
6667
force_thread: force_thread,
6768
in_reply_to_id: in_reply_to_id,
@@ -78,7 +79,7 @@ def create_reply(message)
7879
def done
7980
@queue << :done
8081
@worker_thread.join
81-
ChatSDK::Message.stop_stream(message_id: @reply.id, guardian: @guardian)
82+
ChatSDK::Message.stop_stream(message_id: @reply.id, guardian: @guardian) if @reply
8283
@reply
8384
end
8485

0 commit comments

Comments
 (0)