fix(feishu): reply in same topic instead of creating new one in topic-mode groups - #9760
Closed
zhing2006 wants to merge 1 commit into
Closed
fix(feishu): reply in same topic instead of creating new one in topic-mode groups#9760zhing2006 wants to merge 1 commit into
zhing2006 wants to merge 1 commit into
Conversation
…-mode groups Progress messages and streaming responses were sent via the `create` API (no `reply_to`) instead of the `reply` API. Feishu's `create` API cannot target a specific topic, so messages in topic-mode groups always created a new topic. - Add `reply_to` parameter to `GatewayStreamConsumer` so the first streamed chunk uses the reply API with `reply_in_thread=true` - Pass `event_message_id` as `reply_to` in all three progress-message send paths in `send_progress_messages()` - Add defensive `root_id` fallback for `thread_id` in forum-type chats Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
|
Hey, just wanted to check in, this fixes an issue I ran into where the bot keeps opening new topics in Feishu topic-mode groups instead of replying in the same thread. Tested it on my end and it's working. Would appreciate it if someone could approve the CI run when they get a moment. Let me know if anything needs changing! |
19 tasks
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 bot replies creating a new topic instead of replying within the existing topic in topic-mode groups (话题模式群).
Root cause: progress messages and streaming responses were sent via the Feishu
createAPI (noreply_toparameter), which cannot target a specific topic. Only thereplyAPI withreply_in_thread=truecan send messages into an existing topic. Sincereply_towas missing, the code fell through to thecreatebranch in_send_raw_message(), causing every bot response to appear as a new topic.Related Issue
Fixes #6969
Type of Change
Changes Made
gateway/stream_consumer.py: Add optionalreply_toparameter toGatewayStreamConsumer.__init__()and use it in_send_or_edit()when sending the first message chunkgateway/run.py: Passreply_to=event_message_idin all 3 progress-messageadapter.send()calls insidesend_progress_messages(), and in theGatewayStreamConsumerconstructorgateway/platforms/feishu.py: Add defensiveroot_idfallback forthread_idin_process_inbound_message()for forum-type chats (topic-mode groups wherethread_idmay be absent); add debug logging for thread contextHow to Test
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/AScreenshots / Logs
Before fix —
_send_raw_messagelog showingreply_to=None:After fix — bot reply correctly appears within the same Feishu topic.