Skip to content

fix(feishu): handle quote field for quoted replies - #22969

Closed
KhanCold wants to merge 2 commits into
NousResearch:mainfrom
KhanCold:fix/feishu-quote-field-handling
Closed

fix(feishu): handle quote field for quoted replies#22969
KhanCold wants to merge 2 commits into
NousResearch:mainfrom
KhanCold:fix/feishu-quote-field-handling

Conversation

@KhanCold

@KhanCold KhanCold commented May 10, 2026

Copy link
Copy Markdown

Closing as duplicate of #22935 which covers the same fix more comprehensively (including root_id misattribution fix). Thanks for the feedback — will follow #22935 going forward.

Feishu adapter was ignoring the quote field when users reply with a
native quote (selecting part of a previous message). This caused
reply_to_message_id and reply_to_text to be empty, losing reply context.

Now extracts quote.id / quote.message_id and quote.text from the Feishu
message, using them as fallback when parent_id / upper_message_id are
not present. Mirrors the Signal adapter pattern.

Fixes NousResearch#22934
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists platform/feishu Feishu / Lark adapter comp/gateway Gateway runner, session dispatch, delivery labels May 10, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #22935 — same fix for #22934 (Feishu quote field handling). Compare diffs.

@sicnuyudidi

Copy link
Copy Markdown
Contributor

Thanks for this fix! Note that there's a related issue not covered by this PR:

The root_id misattribution problem:
Line 2933 still has:

thread_id = getattr(message, "thread_id", None) or getattr(message, "root_id", None) or None

root_id is the root message ID of a thread, NOT a thread identifier. Using it as thread_id fallback causes quoted replies in P2P (私聊) to be routed to a new "thread" session, because the session key includes thread_id.

This explains why some users see Hermes open a new topic when they reply with a quote in P2P.

Recommended additional fix:

# Only use thread_id for session routing, NOT root_id
thread_id = getattr(message, "thread_id", None) or None

See also: #22935 (our PR that includes both fixes)

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/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants