Skip to content

Enable Topic in Feishu. - #24843

Closed
Readm wants to merge 2 commits into
NousResearch:mainfrom
Readm:feat/feishu-topic-threading-clean
Closed

Readm wants to merge 2 commits into
NousResearch:mainfrom
Readm:feat/feishu-topic-threading-clean

Conversation

@Readm

@Readm Readm commented May 13, 2026

Copy link
Copy Markdown

Enable Topic in Feishu. via root_id/thread_id

  • Resolve thread_id from message.root_id or message.message_id instead of message.thread_id for proper topic threading
  • Route interim/stream/progress messages carrying thread_id metadata into the thread via message.reply() instead of message.create()
  • Fixes Feishu topic threading where messages could land in the main chat instead of inside the topic

What does this PR do?

Enable Topic in Feishu, with this, whenever you chat with the hermes Feishu bot, it create a new Topic in Feishu, corresponding to Session in Hermes. Otherwise, you have only one session to hermes via Feishu (or creat a group and @ him each message)

I like it very much, I'm not sure everybody likes it? should we add a config to it?

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

gateway/platforms/feishu.py

How to Test

Only manully, maybe we can add test that use correct thead_id?

  1. Start Hermes gateway with Feishu enabled
  2. Send a message in a topic/thread → bot should reply inside the topic
  3. Trigger an interim/progress message → it should also land in the topic
  4. pytest tests/gateway/test_feishu.py -q → 194 passed

Checklist

Code

  • [xI've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform:

Readm added 2 commits May 13, 2026 12:29
…s via root_id/thread_id

- Resolve thread_id from message.root_id or message.message_id
  instead of message.thread_id for proper topic threading
- Route interim/stream/progress messages carrying thread_id metadata
  into the thread via message.reply() instead of message.create()
- Fixes Feishu topic threading where messages could land in the
  main chat instead of inside the topic
…ssage routing

- test_inbound_message_uses_root_id_as_thread_id
- test_inbound_message_falls_back_to_message_id_when_no_root_id
- test_inbound_message_no_thread_id_when_neither_root_nor_message_id
- test_send_raw_message_replies_into_thread_when_metadata_has_thread_id
- test_send_raw_message_creates_when_no_reply_to_and_no_thread_id_in_metadata
@alt-glitch alt-glitch added type/feature New feature or request comp/gateway Gateway runner, session dispatch, delivery platform/feishu Feishu / Lark adapter P2 Medium — degraded but workaround exists labels May 13, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

Related: #18385 (open) addresses the same Feishu topic threading issue with a more comprehensive fix covering additional edge cases (opt-in thread_follow mode, gateway session context changes). Also related: #16018, #18121 (closed prior attempts at the same fix).

@Readm Readm closed this May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/feishu Feishu / Lark adapter type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants