fix(feishu): send all messages to topic when in thread#3704
Merged
Conversation
This was referenced May 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
close #3694
Problem
When sending multiple messages (text + files) in a Feishu group topic, only the first message stays in the topic, and subsequent messages get posted directly to the group.
Root Cause
The original code used a
first_sendflag to only send the first message via reply API, and all subsequent messages via regular send API. However, in topics (identified bythread_id), we should always use reply API to keep all messages in the same topic.Solution
has_thread_idcheck:has_thread_id = msg.metadata.get("thread_id")has_thread_id: All messages use reply API to stay in topicreply_to_messageis enabled: Only the first message uses reply API (to avoid duplicate reply bubbles)Testing
test_send_multiple_messages_all_use_reply_when_in_topic: All messages use reply API when in topictest_send_multiple_messages_only_first_uses_reply_when_reply_to_message: Only first message uses reply when not in topic