Skip to content

fix(gateway): anchor Feishu replies to triggering message - #62643

Open
A-HUAN wants to merge 1 commit into
NousResearch:mainfrom
A-HUAN:fix/feishu-reply-anchor
Open

fix(gateway): anchor Feishu replies to triggering message#62643
A-HUAN wants to merge 1 commit into
NousResearch:mainfrom
A-HUAN:fix/feishu-reply-anchor

Conversation

@A-HUAN

@A-HUAN A-HUAN commented Jul 11, 2026

Copy link
Copy Markdown

What does this PR do?

Related Issue

N/A — no related issue.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

Fix Feishu threaded replies so they anchor to the triggering inbound message,
rather than the parent message of that thread. This preserves the thread while
making the bot visibly reply to the user message that triggered it.

How to Test

  1. Run scripts/run_tests.sh tests/gateway/test_platform_base.py -q.
  2. Confirm the Feishu regression case uses the event's message_id rather than
    reply_to_message_id.
  3. Confirm the Telegram topic-routing regression case still passes.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: <!macOS>

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

  • This skill is broadly useful to most users (if bundled) — see Contributing Guide
  • SKILL.md follows the standard format (frontmatter, trigger conditions, steps, pitfalls)
  • No external dependencies that aren't already available (prefer stdlib, curl, existing Hermes tools)
  • I've tested the skill end-to-end: hermes --toolsets skills -q "Use the X skill to do Y"

Screenshots / Logs

@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 sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages labels Jul 11, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Competing with the open Feishu reply-anchor cluster in gateway/platforms/base.py _reply_anchor_for_event(): #23729 (earliest, same approach), #24290, superset #33584 (also drops the invalid thread_id create-API path), and the distinct-mechanism #55766 (DM quote-reply). Cross-linking for maintainer review — these overlap on the same anchor logic.

@A-HUAN

A-HUAN commented Jul 11, 2026

Copy link
Copy Markdown
Author

I reviewed the linked PRs. This PR intentionally focuses on the current-message reply anchor:

If maintainers prefer #33584 or a combined superseding patch, this PR can be closed in favor of that direction.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused regression fix. Current main still returns event.reply_to_message_id for Feishu threaded events in gateway/platforms/base.py:105-107, even though the Feishu adapter stores the triggering inbound ID separately in MessageEvent.message_id (plugins/platforms/feishu/adapter.py:3252-3300) and sends the supplied reply_to through the Feishu reply API (plugins/platforms/feishu/adapter.py:4609-4621).

The change in 101412fb9596 corrects that exact selection by preferring the triggering message ID while retaining the existing fallback, and its helper tests preserve the Telegram DM-topic behavior.

Automated hermes-sweeper review.

@teknium1 teknium1 added the sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform label Jul 11, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related: this is part of the open Feishu reply-anchor cluster in gateway/platforms/base.py _reply_anchor_for_event(): #23729 (earliest, same file), #24290, #33584 (superset, also fixes the invalid thread_id create-API path), and #55766 (DM quote-reply). This PR takes a distinct approach — anchoring to the triggering inbound message via event.message_id and keeping reply_to_message_id only as a fallback — rather than restricting the anchor to true thread replies. Not a duplicate; a maintainer should pick the canonical fix across the cluster.

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.

3 participants