hermes - 💡(How to fix) Fix Feishu adapter doesn't handle quote field for quoted replies [1 pull requests]

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…

Root Cause

In `feishu.py` lines 2700-2706, only `parent_id` and `upper_message_id` are extracted:

reply_to_message_id = (
    getattr(message, \"parent_id\", None)
    or getattr(message, \"upper_message_id\", None)
    or None
)

However, the `quote` field (which contains the quoted message ID and text) is completely ignored.

Fix Action

Fixed

Code Example

reply_to_message_id = (
    getattr(message, \"parent_id\", None)
    or getattr(message, \"upper_message_id\", None)
    or None
)

---

# Extract quote (reply-to) context from Signal dataMessage
quote_data = data_message.get(\"quote\") or {}
reply_to_id = str(quote_data.get(\"id\")) if quote_data.get(\"id\") else None
reply_to_text = quote_data.get(\"text\")

---

# Extract quote (reply-to) context from Feishu message
quote = getattr(message, \"quote\", None) or {}
quote_id = quote.get(\"id\") or quote.get(\"message_id\") or None
quote_text = quote.get(\"text\") or None

# Use quote_id/quote_text as fallback when parent_id/upper_message_id are empty
reply_to_message_id = (
    getattr(message, \"parent_id\", None)
    or getattr(message, \"upper_message_id\", None)
    or quote_id
    or None
)
reply_to_text = reply_to_text or quote_text
RAW_BUFFERClick to expand / collapse

Bug Description

Feishu adapter does not process the `quote` field in incoming messages, which contains the ID and text of the quoted (replied-to) message. This causes:

  1. Reply context loss: The `reply_to_message_id` and `reply_to_text` are empty when users reply with a quote
  2. Session routing issues: The session key may be incorrect due to missing quote context

Root Cause

In `feishu.py` lines 2700-2706, only `parent_id` and `upper_message_id` are extracted:

reply_to_message_id = (
    getattr(message, \"parent_id\", None)
    or getattr(message, \"upper_message_id\", None)
    or None
)

However, the `quote` field (which contains the quoted message ID and text) is completely ignored.

Comparison with Signal Adapter

Signal adapter correctly handles the `quote` field (signal.py lines 509-511):

# Extract quote (reply-to) context from Signal dataMessage
quote_data = data_message.get(\"quote\") or {}
reply_to_id = str(quote_data.get(\"id\")) if quote_data.get(\"id\") else None
reply_to_text = quote_data.get(\"text\")

Expected Behavior

When a user quotes a message and replies in Feishu, the bot should:

  1. Extract the quoted message ID from the `quote` field
  2. Extract the quoted message text from the `quote` field
  3. Populate `reply_to_message_id` and `reply_to_text` in the `MessageEvent`

Proposed Fix

Add quote field processing similar to Signal adapter:

# Extract quote (reply-to) context from Feishu message
quote = getattr(message, \"quote\", None) or {}
quote_id = quote.get(\"id\") or quote.get(\"message_id\") or None
quote_text = quote.get(\"text\") or None

# Use quote_id/quote_text as fallback when parent_id/upper_message_id are empty
reply_to_message_id = (
    getattr(message, \"parent_id\", None)
    or getattr(message, \"upper_message_id\", None)
    or quote_id
    or None
)
reply_to_text = reply_to_text or quote_text

Environment

  • Hermes Agent version: v2026.5.7
  • Platform: Feishu
  • Feishu event type: `im.message.receive_v1`

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