fix(feishu): remove root_id fallback from thread_id resolution - #23282
Closed
KhanCold wants to merge 1 commit into
Closed
fix(feishu): remove root_id fallback from thread_id resolution#23282KhanCold wants to merge 1 commit into
KhanCold wants to merge 1 commit into
Conversation
root_id is the first message in a thread, not a thread identifier. Using it as fallback for thread_id caused P2P quoted replies to be incorrectly routed to a spurious thread session instead of the DM. - Remove from thread_id resolution - Keep root_id in reply_to_message_id (legitimate use) - Add regression test ensuring quoted replies in P2P have thread_id=None Refs: NousResearch#22969 (review comment)
Author
|
Closing this PR as the fix is already being addressed by #20562 (`fix(feishu): avoid threading regular replies`) which covers the same root_id/thread_id issue with regression tests. Thanks for the contribution! |
6 tasks
This was referenced May 20, 2026
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.
Problem
In the Feishu adapter,
root_idwas incorrectly used as a fallback forthread_id:This is wrong because root_id is the first message in a thread, not a thread identifier.
The result: when a user sends a quoted reply in a P2P DM, Hermes would open a spurious thread session (since
root_idis present) instead of continuing the normal DM conversation. This breaks reply threading in private chats.Fix
Remove the
root_idfallback fromthread_idresolution.root_idremains legitimately used inreply_to_message_id(it's the root message of the thread being replied to), but it must not leak into session routing.Regression Test
Added
test_p2p_quote_reply_does_not_use_root_id_as_thread_idintests/gateway/test_feishu.pythat verifies:root_id="om_root"andthread_id=Noneproducesevent.source.thread_id is Nonereply_to_message_idstill correctly captures the parent messageContext
This addresses the issue raised in review comment on #22969 by @sicnuyudidi.