feat: resolve @mentions in direct reply to Feishu at tags - #155
Merged
Conversation
When bot output contains @username that matches a chat member, convert plain text to Feishu post format with structured at elements, so mentions render as blue links with notifications instead of plain text. Falls back to plain text when no mentions found or API fails. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
11 test cases covering: single/multiple mentions, greedy name matching, multi-line text, empty map, no-match fallback, and edge cases. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @lishuceo's task in 1m 21s —— View job Code Review: PR #155 — Resolve @mentions in direct reply
✅ Approved — Clean, well-structured PROverall assessment: This is a solid implementation. The code follows existing patterns in the codebase, has proper error handling with graceful fallback to plain text at every failure point, and ships with good test coverage (11 unit tests on the pure function). What works well:
Minor observations (not blocking):
No issues with confidence ≥ 75 found. LGTM. |
lishuceo
added a commit
that referenced
this pull request
Apr 8, 2026
* feat: resolve @mentions in direct reply to proper Feishu at tags When bot output contains @username that matches a chat member, convert plain text to Feishu post format with structured at elements, so mentions render as blue links with notifications instead of plain text. Falls back to plain text when no mentions found or API fails. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test: add unit tests for mention-resolver 11 test cases covering: single/multiple mentions, greedy name matching, multi-line text, empty map, no-match fallback, and edge cases. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
mention-resolver.ts:解析 bot 输出文本中的@姓名,通过群成员列表匹配 open_id,转换为飞书 post 格式的结构化<at>标签client.ts新增replyPost()/replyPostInThread()方法sendDirectReply()短文本分支:检测到 @mention 时用 post 格式发送,无匹配时 fallback 纯文本@张三丰被@张三先截断Test plan
convertTextWithMentions纯函数memory/quality)🤖 Generated with Claude Code