Skip to content

fix(minimax-bot): @ 前面的词字符按任何书写系统算,点名后侧的边界也写清了 - #96

Merged
MyPrototypeWhat merged 2 commits into
MiniMax-AI:mainfrom
Apageoflove:fix/minimax-bot-mention-boundary
Oct 31, 2026
Merged

MyPrototypeWhat merged 2 commits into
MiniMax-AI:mainfrom
Apageoflove:fix/minimax-bot-mention-boundary

Conversation

@Apageoflove

@Apageoflove Apageoflove commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

点名有两个方向,规则不一样。前面那个方向是上一条 PR(#91)改的:@ 前面只要有一个 ASCII 的字母、数字或下划线,那个点名就不算数——那是邮箱本地部分的样子。中文没有词间空格,所以「请@某人」这种最常见的写法原本全都点不到人;#91 把它改成只有 ASCII 的那几种字符才算地址,中文、日文、韩文紧贴着 @ 写不算,英文一个字节都没动。
这一版把前面那个方向补完整:@ 前面的那个字按任何书写系统的词字符判断——带重音的拉丁字母(josé 这类)、希腊字母、西里尔字母、数字、下划线、组合重音都算地址的一部分,所以这些字接在 @ 前面、后面再跟一个成员名,就跟邮箱地址的本地部分是一个东西,点不到那个成员;中文、日文、韩文紧贴着 @ 写仍然不算地址,请@某人 还是叫得到人。后面那个方向是上游本来就有的语义:名字后面跟着一个还可能是名字一部分的字符,名字就还没结束,所以「@某人帮忙」叫不到某人,「@某人 帮忙」和「@某人,帮忙」叫得到,@设计师傅 不是 设计师。
这两条都在未改的上游代码上用探针复现过:带重音的拉丁字母、希腊字母、西里尔字母接在 @ 前面时,上游都会点到那个成员,改好后不会;英文那一侧 60 种写法在上游和改后逐例比过,一处都没差。新增的两个测试文件在未改的上游代码上是红的,在这版上是绿的;插件自带套件 312 条全过,上游 npm run check 两半也过。
这一版只动 @ 前面那一侧的判定,后面那一侧是上游本来就有的语义、没有动。紧贴中文的 @ 能不能点到人是维护者给的第一种做法,这里沿用;名字后面跟中文时该写空格还是标点,需要确认上游的取向,所以只写进 README,没有改判定。


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@MyPrototypeWhat MyPrototypeWhat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. Approving. Existing English mentions (@alice, @Alice Smith, mail@alice.com) and Chinese mentions (请@某人) behave as before, and the plugin tests and the repo check pass locally.

Optional

  • Full-width letters and digits now block a mention. OK@某人 and 第2@某人 are common with a full-width IME, and they still mentioned the member on 0.7.15. Consider treating the Halfwidth and Fullwidth Forms block (U+FF00 to U+FFEF) as spaceless, with a test.
  • Thai, Lao, Khmer and Myanmar are also written without spaces, so ขอบคุณ@alice no longer mentions. Probably rare, but you could add those scripts to the spaceless set or note the limitation in the README.
  • The README rewrites the 0.7.13 entry instead of adding one for 0.7.16, so readers won't see that the rule changed (josé@alice mentioned on 0.7.15 and doesn't now). A short 0.7.16 section would keep the history accurate.

On your question about names followed directly by Chinese text: let's keep the current rule and just document it, as this PR does. If a name could run straight into CJK text, @设计师傅 would also match a member named 设计师.

@MyPrototypeWhat
MyPrototypeWhat merged commit 79ebc4b into MiniMax-AI:main Oct 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants