fix(feishu): route topic messages to thread ids - #9986
Closed
LeonSGP43 wants to merge 1 commit into
Closed
Conversation
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-thread routing for P2P chats.
When a user sends a message from a Feishu topic thread inside a P2P chat, Hermes was creating a new outbound message with
receive_id_type="chat_id"even whenthread_idwas present in metadata. That caused replies to appear in the main chat instead of the topic.This change keeps the existing reply flow intact, but makes non-reply sends target
thread_idwhenever thread metadata is present.Related Issue
Fixes #9916
Type of Change
Changes Made
thread_idinstead ofchat_idwhenmetadata["thread_id"]is present in gateway/platforms/feishu.pyreply_tobehavior andreply_in_threadhandling for true reply sendsreceive_id_type="thread_id"in tests/gateway/test_feishu.pyHow to Test
source .venv/bin/activate && python -m pytest tests/gateway/test_feishu.py -qtest_send_routes_new_message_to_thread_when_thread_metadata_presentChecklist
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/AScreenshots / Logs
tests/gateway/test_feishu.py -q→107 passedpytest tests/ -qcurrently has unrelated pre-existing failures onmain