feat(gateway): Feishu auto-thread and topic-based session routing - #9118
feat(gateway): Feishu auto-thread and topic-based session routing#9118keenlin wants to merge 2 commits into
Conversation
445f684 to
9da6063
Compare
|
GatewayStreamConsumer/interim messages could send with thread_id but no reply_to, which fell back to CreateMessage and posted to the parent group. This follow-up fix routes those thread-context sends through the Reply API so they stay inside the topic. |
Add automatic topic creation and thread-level session isolation for Feishu
group chats:
- Auto-thread: when enabled, creates a topic for qualifying top-level group
messages by sending a placeholder reply ("Thinking..."), then editing
it with the actual response once processing completes
- Topic session isolation: messages within a Feishu topic automatically
carry their own independent conversation context
- Thread tracking: persistent _bot_participated_threads set for mention
policy management in bot-participated topics
- Configurable via FEISHU_AUTO_THREAD, FEISHU_NO_THREAD_GROUPS, and
FEISHU_THREAD_REQUIRE_MENTION with per-group overrides
835e7c2 to
a79920f
Compare
|
Thanks for the detailed adapter work and the follow-up addressing interim thread-context sends. This automated hermes-sweeper review is closing the PR under the standing configuration policy:
Please re-scope any follow-up around Closed as not-planned per standing maintainer policy ( |
What does this PR do?
Closes #9154
Problem: Discord is inaccessible in China, leaving users without a thread-isolated gateway
option. This PR implements auto-thread and topic-based session isolation,
filling that gap.
Platform adaptation note: Feishu lacks Discord's explicit thread creation API. We
use a placeholder message as a compensating pattern — sending "🔄 Thinking..." with
reply_in_thread=trueforces topic creation, allowing the first message to route intothe correct thread session.
Key Features:
FEISHU_AUTO_THREAD: Auto-create topics for group mentions (likeDISCORD_AUTO_THREAD)(intrinsic, no toggle)
FEISHU_THREAD_REQUIRE_MENTION: Control mention requirements in bot-participatedtopics
Discord Alignment:
DISCORD_AUTO_THREADFEISHU_AUTO_THREADDISCORD_NO_THREAD_CHANNELSFEISHU_NO_THREAD_GROUPS_bot_participated_threadsChanges Made
gateway/platforms/feishu.py: Auto-thread bootstrap, root_id session routing,thread tracking persistence
hermes_cli/config.py: Register new env varstests/gateway/test_feishu.py: Thread routing testswebsite/docs/user-guide/messaging/feishu.md: Thread Routing documentationHow to Test
Type of Change
Checklist