fix(feishu): allow punctuation after mention placeholders

maintainer edit: Keep the shared-prefix guard for Feishu numbered mention keys while still resolving placeholders followed by punctuation, matching the previous user-visible mention behavior.
This commit is contained in:
chengyongru
2026-06-05 15:55:53 +08:00
committed by Xubin Ren
parent 894811db8b
commit c574b028c1
2 changed files with 10 additions and 2 deletions
+6
View File
@@ -44,6 +44,12 @@ class TestResolveMentions:
assert "@_user_1" not in result
assert "@_user_2" not in result
def test_mention_before_punctuation_replaced(self):
text = "hello @_user_1, are you there?"
mentions = [_mention("@_user_1", "Alice", open_id="ou_a")]
result = FeishuChannel._resolve_mentions(text, mentions)
assert result == "hello @Alice (ou_a), are you there?"
def test_no_mentions_returns_text(self):
assert FeishuChannel._resolve_mentions("hello world", None) == "hello world"
assert FeishuChannel._resolve_mentions("hello world", []) == "hello world"