hermes - 💡(How to fix) Fix feat(feishu): opt-in reply_in_thread for @-mention replies to keep main chat clean

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…

Today, when a user @-mentions the bot in the main Feishu group chat (not from inside an existing topic thread), the bot's reply is posted as a regular reply in the main chat. For agents that produce multi-message responses or display progress messages (e.g. execute_code, Interrupting/iteration heartbeats, multi-chunk long answers), this floods the main channel.

Feishu already supports a clean solution: passing reply_in_thread=true to the reply API makes the message automatically create a new topic thread if the source message isn't already in one. The bot's response (and all follow-up chunks) collapses into a [N replies] link in the main chat — see the Thread Introduction docs.

Root Cause

Today, when a user @-mentions the bot in the main Feishu group chat (not from inside an existing topic thread), the bot's reply is posted as a regular reply in the main chat. For agents that produce multi-message responses or display progress messages (e.g. execute_code, Interrupting/iteration heartbeats, multi-chunk long answers), this floods the main channel.

Feishu already supports a clean solution: passing reply_in_thread=true to the reply API makes the message automatically create a new topic thread if the source message isn't already in one. The bot's response (and all follow-up chunks) collapses into a [N replies] link in the main chat — see the Thread Introduction docs.

Fix Action

Fix / Workaround

Side effects (verified locally on snapshot c681687, patched to reply_in_thread = bool(reply_to) as a hardcoded test)

Code Example

reply_in_thread = bool((metadata or {}).get("thread_id"))

---

messaging:
  feishu:
    # Default: false (current behavior — only reply in thread when inbound is already in a thread)
    # true: any reply-style message (with reply_to) auto-creates a topic thread
    always_reply_in_thread: true

---

reply_in_thread = bool(reply_to) if config.always_reply_in_thread else bool((metadata or {}).get("thread_id"))
RAW_BUFFERClick to expand / collapse

Summary

Today, when a user @-mentions the bot in the main Feishu group chat (not from inside an existing topic thread), the bot's reply is posted as a regular reply in the main chat. For agents that produce multi-message responses or display progress messages (e.g. execute_code, Interrupting/iteration heartbeats, multi-chunk long answers), this floods the main channel.

Feishu already supports a clean solution: passing reply_in_thread=true to the reply API makes the message automatically create a new topic thread if the source message isn't already in one. The bot's response (and all follow-up chunks) collapses into a [N replies] link in the main chat — see the Thread Introduction docs.

Current behavior

In gateway/platforms/feishu.py, _send_raw_message only sets reply_in_thread=true when the inbound message is already part of a thread:

reply_in_thread = bool((metadata or {}).get("thread_id"))

So @-mentions in the main chat → bot reply lives in the main chat.

Proposed behavior

Add a config option under messaging.feishu:

messaging:
  feishu:
    # Default: false (current behavior — only reply in thread when inbound is already in a thread)
    # true: any reply-style message (with reply_to) auto-creates a topic thread
    always_reply_in_thread: true

When the flag is on, _send_raw_message would compute:

reply_in_thread = bool(reply_to) if config.always_reply_in_thread else bool((metadata or {}).get("thread_id"))

Active push messages (no reply_to) take the create API branch and are unaffected — scheduled daily reports etc. still post normally to the main chat.

Why opt-in

Opt-in keeps the change fully backward compatible. Operators who run noisy agents in shared channels will turn it on; others keep current behavior.

Side effects (verified locally on snapshot c681687, patched to reply_in_thread = bool(reply_to) as a hardcoded test)

ScenarioBeforeAfter (with flag on)
@-mention in main chatreply visible in mainauto-creates topic thread ✅
@-mention inside existing threadreply in same threadreply in same thread (unchanged)
Long multi-chunk replyevery chunk in mainfirst chunk creates thread, subsequent chunks join it (Feishu API behavior)
Scheduled push (reply_to=None)create API, posts to mainunchanged (doesn't touch reply API)
edit_message (in-place updates)unaffectedunaffected
P2P DM repliesreply in DMnow also threaded — DMs don't have a visible "main stream" so UX is similar

Related

  • #9916 — bot replies leak out of P2P topic thread (the inverse direction; partially handled by current metadata.thread_id logic)

Happy to send a PR if this direction sounds right.

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 - 💡(How to fix) Fix feat(feishu): opt-in reply_in_thread for @-mention replies to keep main chat clean