fix(feishu): distinguish quote replies from topic sessions - #36233
fix(feishu): distinguish quote replies from topic sessions#36233SergioYin wants to merge 1 commit into
Conversation
|
Thanks for triaging this. Quick reviewer context: this PR is intentionally narrow and fixes Feishu/Lark quoted-message routing so ordinary quote replies stay in the current DM/group session, while topic/thread routing remains preserved. It also adds targeted gateway tests for quote replies, topic sessions, and the forum root_id fallback. Happy to adjust the approach if there is a preferred pattern for this subsystem. |
687c08d to
6e1b12b
Compare
|
Rebased/refreshed this fork branch onto current Current state for review:
The two warnings are existing |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused routing analysis. The underlying defect is still present on current main: plugins/platforms/feishu/adapter.py:3252 still promotes root_id into thread_id, and gateway/session.py:913-915 then creates a separate DM session key.
Problems
- The PR edits
gateway/platforms/feishu.py, but current main moved the active adapter toplugins/platforms/feishu/adapter.pyin5600105478ffde29d7566b45421b100eaa29c4ef. The old module is deleted, so this change does not reach the live adapter as written. - The new tests use the same obsolete module path. Current Feishu tests import
plugins.platforms.feishu.adapter.
Suggested changes
- Port the resolver and regression tests to
plugins/platforms/feishu/adapter.py, replacing the current fallback at line 3252 while retainingroot_idforreply_to_message_idat lines 3253-3259.
Automated hermes-sweeper review.
| @@ -3072,14 +3072,34 @@ async def _process_inbound_message( | |||
| if hint: | |||
| text = f"{hint}\n\n{text}" if text else hint | |||
|
|
|||
| thread_id = getattr(message, "thread_id", None) or getattr(message, "root_id", None) or None | |||
| chat_id = getattr(message, "chat_id", "") or "" | |||
There was a problem hiding this comment.
Current main removed this module in 5600105478ffde29d7566b45421b100eaa29c4ef; the active adapter is plugins/platforms/feishu/adapter.py. Please port this routing change and its tests to that plugin path so the fix reaches the live inbound pipeline.
Keep ordinary Feishu/Lark quote replies in the current DM or group session while preserving quoted text/media as reply context. Preserve explicit topic/thread routing and keep a forum-scoped root_id fallback for older topic payloads.
6e1b12b to
ed93e5f
Compare
|
Thanks for the review. I’ve ported the fix and its regression tests to the active Feishu adapter at To restate the user-facing issue: in normal conversation, quoting a message is intended to inject or emphasize context within the current conversation. Previously, Feishu reply metadata such as The updated implementation makes that distinction explicit: quote metadata remains reply context, while an explicit The regression coverage now verifies that:
Validation on the updated branch:
|
Problem
In normal conversation, quoting a message is intended to inject or emphasize context within the current conversation.
Previously, Feishu reply metadata such as
root_idcould be promoted into the Hermes thread route. As a result, an ordinary quote reply could be routed into a separate topic-scoped session. From the user's perspective, quoting a message unexpectedly opened a fresh context instead of reinforcing the current one.What changed
This PR makes the distinction explicit in the active Feishu adapter at
plugins/platforms/feishu/adapter.py:thread_idselects a topic-scoped session;root_idcompatibility fallback is preserved;In short:
Behavior
thread_idand continue the topic-scoped session.root_idfallback when an explicitthread_idis unavailable.This avoids the previous behavior where quoting a message could silently move the user into a different Hermes session.
Changes made
plugins/platforms/feishu/adapter.py_resolve_inbound_thread_id()to centralize reply/topic routing semantics.tests/gateway/test_feishu.pytests/gateway/test_run_progress_topics.pywebsite/docs/user-guide/messaging/feishu.mdRelated issue
Fixes #20548.
Related context: #20562, #29467, #30164, #20851.
Type of change
Validation
Relevant gateway test suite:
Additional checks:
Tested on Ubuntu/WSL2 with a Feishu/Lark gateway, including real-workspace validation of quote replies and topic replies.
Checklist