fix(gateway): keep Feishu topic replies in thread - #16442
Closed
Kayphoon wants to merge 1 commit into
Closed
Conversation
Kayphoon
force-pushed
the
fix/feishu-topic-replies
branch
from
April 27, 2026 09:55
55edd57 to
0f14712
Compare
Contributor
|
Thanks for the focused Feishu topic-routing work. An automated hermes-sweeper review found that current
Closing as implemented on main; the current implementation also covers overflow and fallback thread-routing paths beyond this pre-plugin diff. |
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.
What does this PR do?
Fixes Feishu topic-mode replies so Hermes responses stay inside the originating topic instead of falling back to the main group. Feishu topic events carry the topic root as
root_id, and Feishu only places messages in a topic when the reply API has a message-id target plusreply_in_thread=true.This PR keeps the fix narrow:
message.root_idwhen derivingSessionSource.thread_idfor Feishu inbound messages.metadata["thread_id"]is anom_...root message id, use it as the implicit reply target; rejectomt_...topic resource ids as reply targets.Related context: #16131, #9118, #9760. This is not just a duplicate of #16131 because it also fixes streamed replies and metadata-only Feishu sends; it is narrower than #9118 and does not add auto-threading.
Related Issue
Related to #6969
Type of Change
Changes Made
gateway/platforms/feishu.pyroot_idbeforethread_idfor topic/session routingom_...thread metadata as a safe implicit reply target for metadata-only topic sendsomt_...topic resource ids as message reply targetsgateway/stream_consumer.pyreply_tosupport and carries it through first-send/fallback/fresh/commentary stream sendsgateway/run.pyevent_message_idto stream consumers only whensource.thread_idexiststests/gateway/test_feishu.pyomt_...rejection coveragetests/gateway/test_stream_consumer.pyreply_tocoverageHow to Test
Observed locally after rebasing onto latest
origin/main:232 passed, 37 skipped, 4 warningspy_compile: passedFull-suite note:
scripts/run_tests.shwith no args currently exits before pytest withARGS[@]: unbound variable.scripts/run_tests.sh tests/was attempted and reached pytest, but the local environment/mainline suite failed on unrelated existing/optional-dependency issues (for example missingfaster_whisper, ACP/TTS optional imports, Slack progress default test, and other broad current-main failures). The Feishu/streaming targeted suite above passes cleanly.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
N/A
Screenshots / Logs
Targeted regression output: