Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lark_channel/channel/outbound/sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,11 @@ async def send(
last_result: SendResult = SendResult.fail(SendError(code=FeishuChannelErrorCode.UNKNOWN, retryable=False))
for idx, body in enumerate(body_list):
req_uuid = uuid_ if (idx == 0 and uuid_) else str(uuid.uuid4())
# Only apply `reply_to` to the first chunk; subsequent chunks are
# fresh messages so they all render in the original chat.
effective_reply_to = reply_to if idx == 0 else None
# Apply `reply_to` to the first chunk, and to every chunk when threading.
# A fresh (non-reply) message renders in the origin chat for a normal reply,
# but in a THREAD/topic chat it drops out of the thread into the main chat —
# so later chunks must keep the reply to stay in the thread.
effective_reply_to = reply_to if (idx == 0 or reply_in_thread) else None
result = await self._send_one_with_fallback(
body=body,
receive_id=receive_id,
Expand Down