Skip to content

fix(feishu): preserve reply context from root_id - #18567

Open
CNSeniorious000 wants to merge 2 commits into
NousResearch:mainfrom
CNSeniorious000:fix/feishu-reply-to-context
Open

fix(feishu): preserve reply context from root_id#18567
CNSeniorious000 wants to merge 2 commits into
NousResearch:mainfrom
CNSeniorious000:fix/feishu-reply-to-context

Conversation

@CNSeniorious000

@CNSeniorious000 CNSeniorious000 commented May 1, 2026

Copy link
Copy Markdown
Contributor

Fixes #18566.

Summary

Treat Feishu/Lark root_id as a fallback inbound reply target after parent_id and upper_message_id.
Avoid treating a message as replying to itself when root_id equals the current message_id.
Add Feishu adapter regression coverage for parent-id, root-id-only, and self-root reply context handling.
Add the commit author's AUTHOR_MAP entry so the contributor audit can pass once fork workflows are approved.

Scope

This PR is limited to inbound reply-to context: it only uses root_id as a fallback for MessageEvent.reply_to_message_id. It does not change outbound Feishu topic/thread routing or source.thread_id behavior, which are covered separately by #16131 and #8656.

Test Plan

uv run pytest tests/gateway/test_feishu.py -q -o 'addopts='
uv run python scripts/contributor_audit.py --since-tag v2026.4.30 --diff-base origin/main --strict

Review

Codex read-only correctness review: no blockers.
Codex simplify/atomicity review: no blockers; confirmed no interactive-card changes.

CI

GitHub Actions are currently ACTION_REQUIRED for this fork PR and need maintainer approval before running.

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

Copy link
Copy Markdown
Contributor

Thanks for the focused inbound reply-context coverage. The root_id fallback itself is already present on current main at plugins/platforms/feishu/adapter.py:3253-3258, migrated by 5600105478ffde29d7566b45421b100eaa29c4ef; however, the self-root protection is still absent. Current code fetches the selected target at plugins/platforms/feishu/adapter.py:3259 and forwards it into MessageEvent at :3292-3301.

Problems

  • The PR modifies gateway/platforms/feishu.py, which no longer exists on current HEAD; the live adapter is plugins/platforms/feishu/adapter.py.
  • scripts/release.py:473 already contains the proposed me@promplate.dev AUTHOR_MAP entry.

Suggested changes

  • Port the self-root guard to plugins/platforms/feishu/adapter.py after the existing fallback resolution, and adapt the root-only/self-root tests to the current plugin import path.
  • Leave the existing parent/upper/root precedence unchanged and omit the duplicate AUTHOR_MAP hunk.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 12, 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 sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feishu replies can lose reply-to context when only root_id is present

3 participants