hermes - ✅(Solved) Fix Feishu topic progress messages can still create new topics [1 pull requests, 4 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#17875Fetched 2026-05-01 05:55:24
View on GitHub
Comments
4
Participants
2
Timeline
9
Reactions
0
Author
Participants
Timeline (top)
commented ×4labeled ×4cross-referenced ×1

Root Cause

Root Cause Hypothesis

Fix Action

Fixed

PR fix notes

PR #17877: fix(feishu): keep progress messages in topic threads

Description (problem / solution / changelog)

Summary

Fixes #17875.

This keeps Hermes streaming/progress messages inside the original Feishu/Lark topic thread instead of letting the first/intermediate message create a new topic.

Changes:

  • pass the inbound Feishu message id to GatewayStreamConsumer for Feishu topic-thread requests, so the first streamed/progress send can use message.reply;
  • when Feishu has no reply_to but does have metadata["thread_id"], create the message with receive_id_type="thread_id" instead of chat_id;
  • add regression coverage for both the Feishu adapter path and the stream consumer first-send path.

Test Plan

python -m pytest tests/gateway/test_feishu.py tests/gateway/test_stream_consumer.py -q

Result: 274 passed, 4 warnings in 8.25s.

Changed files

  • gateway/platforms/feishu.py (modified, +6/-3)
  • gateway/run.py (modified, +10/-0)
  • gateway/stream_consumer.py (modified, +7/-1)
  • tests/gateway/test_feishu.py (modified, +42/-0)
  • tests/gateway/test_stream_consumer.py (modified, +50/-0)
RAW_BUFFERClick to expand / collapse

Bug Description

In a Feishu/Lark topic-mode group, Hermes can split one logical interaction across topics: final responses usually stay in the original topic, but intermediate streaming/tool-progress/status messages can appear as new top-level topic messages.

We reproduced this in a Feishu group topic. This matches the behavior discussed in #6969 and #7734, and the fixes proposed in #13077 / #16603.

Steps to Reproduce

  1. Configure Hermes gateway with Feishu/Lark WebSocket integration.
  2. Open an existing topic/thread in a Feishu topic-mode group.
  3. Mention Hermes in that topic and ask a question that triggers tool use or streamed/intermediate status output.
  4. Observe where the tool progress / interim messages are posted.

Expected Behavior

All outbound messages for the request should remain scoped to the original Feishu topic/thread:

  • first streamed response chunk
  • tool-progress messages
  • interim assistant/status messages
  • approval/progress cards
  • final response

Actual Behavior

Some intermediate messages are sent without a topic/thread anchor. Feishu treats those sends as message.create at the chat level, so they can appear as new topics instead of replies inside the original topic.

Root Cause Hypothesis

There are two related paths:

  1. GatewayStreamConsumer creates the first streamed message before it has a platform message_id, so the first send can go out without reply_to.
  2. FeishuAdapter._send_raw_message() ignores metadata["thread_id"] when reply_to is absent and always creates with receive_id_type="chat_id".

For Feishu topic threads, message.reply with the inbound message_id, or message.create with receive_id_type="thread_id", keeps the message in the existing topic.

Related Work

  • Related issue: #6969
  • Related issue: #7734
  • Related PR: #13077
  • Related PR: #16603

Proposed Fix

I will submit a PR that:

  • passes the inbound message id into GatewayStreamConsumer only for Feishu threaded runs, so the first streaming send can reply to the topic message;
  • makes Feishu message.create use receive_id_type="thread_id" when reply_to is absent but metadata["thread_id"] is present;
  • adds regression tests for both paths.

Test Plan

  • python -m pytest tests/gateway/test_feishu.py tests/gateway/test_stream_consumer.py -q

extent analysis

TL;DR

To fix the issue of intermediate messages being sent as new top-level topic messages in Feishu/Lark topic-mode groups, modify the GatewayStreamConsumer and FeishuAdapter._send_raw_message() to properly handle reply_to and thread_id metadata.

Guidance

  • Verify that the GatewayStreamConsumer is correctly passing the inbound message ID for Feishu threaded runs to ensure the first streaming send can reply to the topic message.
  • Check the FeishuAdapter._send_raw_message() method to ensure it uses receive_id_type="thread_id" when reply_to is absent but metadata["thread_id"] is present.
  • Review the proposed fix and test plan to ensure they address the root cause hypothesis and cover both related paths.
  • Run the regression tests using python -m pytest tests/gateway/test_feishu.py tests/gateway/test_stream_consumer.py -q to verify the fix.

Example

No code snippet is provided as the issue does not contain sufficient code details.

Notes

The proposed fix and test plan seem to address the root cause hypothesis, but it's essential to review and test them thoroughly to ensure they resolve the issue.

Recommendation

Apply the proposed workaround by modifying the GatewayStreamConsumer and FeishuAdapter._send_raw_message() as described, and then run the regression tests to verify the fix. This approach directly addresses the identified root cause and provides a clear path to resolving the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix Feishu topic progress messages can still create new topics [1 pull requests, 4 comments, 2 participants]