Conversation
JingZed
force-pushed
the
fix/feishu-quoted-reply-visibility-upstream
branch
from
August 9, 2026 18:30
fbad272 to
c52a614
Compare
Contributor
Duplicate of #30164: both preserve root_id for non-p2p routing while preventing a Feishu DM quote root from becoming thread metadata. |
Author
Author
|
Closing as duplicate of #30164. |
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 Feishu quoted replies in direct messages being routed as topic/thread messages and disappearing from the main conversation.
Feishu sets
root_idon a quoted/replied DM to identify the root of the reply chain. The adapter previously promoted that value tosource.thread_idwhenever a realmessage.thread_idwas absent. Downstream reply routing then treated an ordinary DM quote chain as a topic/thread and anchored the bot response to the quoted message instead of the new triggering message.Root cause
In a
p2pchat,root_idis reply-chain context, not topic routing metadata. It already remains available throughreply_to_message_id; it should not also becomesource.thread_id.Fix
p2pchats, populate normalizedsource.thread_idonly from an actualmessage.thread_id.root_idfallback for non-p2pchats, because Feishu group topics may use it as routing context.root_idas thereply_to_message_idfallback in all chats.message.thread_idis absent;root_idrouting remains unchanged.Reproduction
On current
main, the DM regression test fails with:The normalized DM event incorrectly receives
source.thread_id = root_id.Test plan
scripts/run_tests.sh tests/gateway/test_feishu.py -q78 passed, 0 failedruff check plugins/platforms/feishu/adapter.py tests/gateway/test_feishu.pygit diff --check