fix(feishu): allow bare @mention with no text to trigger bot response in group chats - #57800
Closed
luxuguang-leo wants to merge 1 commit into
Closed
luxuguang-leo wants to merge 1 commit into
luxuguang-leo wants to merge 1 commit into
Conversation
In Feishu group chats, a bare @mention (e.g. just @bot with no text) is silently dropped by the guard in _process_inbound_message(). After _strip_edge_self_mentions() strips the mention prefix, the empty string hits the 'not text and not media_urls' guard and returns early, even though the mentions list is populated. Narrow the guard to only drop messages that have neither text content nor @mentions. When mentions are present, the existing _build_mention_hint() builds a mention text (e.g. @bot) and the rest of the pipeline proceeds normally. Together with PR NousResearch#52908 (group context via _fetch_recent_group_context), a bare @mention now produces a context-aware response instead of silence. Related: NousResearch#55530, NousResearch#52908
19 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a user sends a bare @mention with no text in a Feishu group chat (e.g. just
@Bot), the gateway silently drops the message. The guard at_process_inbound_message()catches the empty string after mention stripping and returns early, leaving the user with no response or feedback.This is especially noticeable now that the group context feature (PR #52908, also addressing #55530) lets the agent see prior discussion. A bare @mention is the natural way to re-engage the bot without repeating context — but the guard blocks it entirely.
Root Cause
After
_strip_edge_self_mentions()strips the @-mention prefix, a bare@Botbecomes empty string. The guard checksnot textbut never inspects thementionslist.Changes
plugins/platforms/feishu/adapter.py— 1 file, +6/-3 linesNarrow the empty-text guard to only drop messages that have neither text content nor @mentions:
When the guard passes,
_build_mention_hint()builds a mention text (e.g.@Bot), and the pipeline proceeds normally.Relationship with PR #52908
Together with #52908 (group context via
_fetch_recent_group_context), a bare @mention now produces a context-aware response instead of silence.Testing
@Botin group → bot responds with context@Bot with text→ unchanged behavior/command→ unchanged behaviorRelated: #55530, #52908