Skip to content

fix(feishu): send all messages to topic when in thread#3704

Merged
Re-bin merged 1 commit into
HKUDS:mainfrom
yorkhellen:fix/feishu-multiple-files-topic
May 8, 2026
Merged

fix(feishu): send all messages to topic when in thread#3704
Re-bin merged 1 commit into
HKUDS:mainfrom
yorkhellen:fix/feishu-multiple-files-topic

Conversation

@yorkhellen
Copy link
Copy Markdown
Contributor

@yorkhellen yorkhellen commented May 8, 2026

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_send flag to only send the first message via reply API, and all subsequent messages via regular send API. However, in topics (identified by thread_id), we should always use reply API to keep all messages in the same topic.

Solution

  • Added has_thread_id check: has_thread_id = msg.metadata.get("thread_id")
  • Logic:
    • If has_thread_id: All messages use reply API to stay in topic
    • Else if reply_to_message is enabled: Only the first message uses reply API (to avoid duplicate reply bubbles)

Testing

  • Added two new test cases:
    • test_send_multiple_messages_all_use_reply_when_in_topic: All messages use reply API when in topic
    • test_send_multiple_messages_only_first_uses_reply_when_reply_to_message: Only first message uses reply when not in topic

Copy link
Copy Markdown
Collaborator

@chengyongru chengyongru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT

@chengyongru chengyongru added valid channel bug Something isn't working labels May 8, 2026
Copy link
Copy Markdown
Collaborator

@Re-bin Re-bin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@Re-bin Re-bin merged commit 843e96f into HKUDS:main May 8, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working channel valid

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feishu group topic 中 nanobot 发送多个文件,一个会发送到topic,另一个发送到 group

3 participants