fix(feishu): resolve thread root message_id for topic reply - #61380
Closed
LigHt3r2 wants to merge 1 commit into
Closed
fix(feishu): resolve thread root message_id for topic reply#61380LigHt3r2 wants to merge 1 commit into
LigHt3r2 wants to merge 1 commit into
Conversation
- Add _get_thread_root_message_id() to resolve thread root via SDK list API - Modify _send_raw_message() to use reply API with reply_in_thread=true - Fixes topic group messages falling back to create API instead of reply
1 task
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.
Summary
Fix the Feishu bot reply behavior in topic/thread group chats.
Currently bot replies appear as standalone messages instead of threaded replies.
Problem
When
_send_raw_message()receives a message withthread_idmetadatain Feishu topic groups, the existing code treats
thread_id(formatomt_xxx) asreceive_idforCreateMessage, which creates a newstandalone message instead of a reply in the thread.
Solution
_get_thread_root_message_id()method: uses Feishu SDK'sListMessageRequestAPI (container_id_type="thread") to list messagesin the thread, identifies the root message (where
root_idis absentor equals its own
message_id)._send_raw_message(): first resolve theroot message ID, then call the Reply API with
reply_in_thread=true,so the response correctly appears as a threaded reply.
SendResulterror on resolution failure, no silentfallback.
Changes
plugins/platforms/feishu/adapter.py: +50 / -8 lines_get_thread_root_message_id()method_send_raw_message()thread_id branchTesting