Repository navigation
fix(minimax-bot): 紧贴中文的点名能点到了,模型写的字段和群里的回复也伪造不了上下文块 - #91
Merged
MyPrototypeWhat merged 1 commit intoOct 28, 2026
Merged
MyPrototypeWhat merged 1 commit into
MyPrototypeWhat merged 1 commit into
Conversation
MyPrototypeWhat
approved these changes
Oct 28, 2026
MyPrototypeWhat
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for this. Approving. I checked out 8742823 and compared it against main. Nothing here can harm MiniMax Code, credentials, other plugins' data or user data, and all changes stay inside plugins/minimax-ai/minimax-bot/.
Verified
npm run checkat the repo root passes.- Plugin tests: 279 run, 275 pass. The 4 failures also fail on main (one reactions test, three emoji picker tests). All 13 new tests pass.
- The version is 0.7.13 in
plugin.json,package.json, the MCPserverInfoand the README changelog. a@b.com,mail@alice.com,1@alice,_@aliceand@alicexare not mentions.请@alice,(@alice),,@alice,x.@alice,-@aliceand a leading@aliceare mentions. English behavior is unchanged.- Names, roles, the group name and notice, instructions, the roster, catch-up lines, the handover
fromand memory text are cleaned before they go inside block markers. Ordinary text like<div>ora<bis left alone.
Optional
- A Chinese name followed directly by more Chinese still doesn't resolve:
@某人帮忙and请@某人看reach nobody, because the next CJK character counts as a word character. You could note this in the README or drop the trailing boundary check for CJK names. - Any non-ASCII letter before
@now starts a mention, sojosé@alice…would pingalice. Rare, but worth knowing. helper.briefinengine.mjs(around line 1778) still insertsbot.nameandbot.roleraw inside<minimax-bot-helper>. Wrapping them inclean()would close that path.neutralizeMarksmisses a zero-width character inside the tag (<\u200b/minimax-bot-context>) and attributes over 40 characters. Both predate this PR.- Consider neutralizing generic system-style tags like
<system-reminder>too, so chat text can't pose as a system note to the model.
None of this blocks the merge.
This was referenced Oct 29, 2026
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.
群里点名原本有个坑:@ 前面只要是任何语言的字母,那个点名就不算数。判断用的是是不是词字符,而汉字也算词字符,中文词与词之间本来就没有空格,于是请@某人、好的@某人、麻烦@某人 看一下这几种最常见的写法全都点不到人。管理员只能自己先答一遍,再在回话里重新点一次名,那位才被叫上,同一件事于是多绕一圈、多跑几轮模型。现在只有 ASCII 的字母、数字和下划线挡在 @ 前面才算数,那才是邮箱本地部分的样子。英文一个字节都没改:邮箱地址那种写法、以及字母紧贴在 @ 前面的,都照样不算点名;@alice、@alice. 和 @alice Smith 照样算,名字后面接着别的词(@alicex)照样不算。我把英文的四十种写法在上游和改后各跑一遍,一处都没差,变的只有前面那个字不是 ASCII 的那八种。
真模型里对着量了一次,两版在同一群里发同一句 请@设计师,群里是 Chief、设计师、写手、审核四个 Bot。上游 0.7.12 是 Chief 先说、设计师靠接力才轮到,群里过了 5 个回合,宿主日志里 4 次模型调用;改好后设计师直接接话,1 次调用。同一句里点两个人也一样:上游只点到了前面有空格的 @审核,紧贴中文的 @写手 根本没点着;改好后两个都被点到。
另一处是协议标记。群里常驻简报和记忆块都带标记,名字、角色、群公告、Bot 的指令、记忆条目都是模型(或你)能写的,它们会被读进这些块里;群里别人的回复和用户消息也会跟着进下一个 Bot 的提示词。标记写在里面就能把块提前关掉,或者在下一个 Bot 的提示词里另开一个块,后面的文字看上去就像插件自己说的。这些标记现在和回复里的一样处理:去掉标记本身,周围的字不动。上游上我按注入点乘拼写跑了六十六种组合,英文中文各半,六十二种是漏的;改完六十六种全过。真模型里也照着量了:用户那句里的标记、Bot 指令里的、角色里的、Bot 自己回话里抄的,四种进到下一个 Bot 的提示词里,上游原样留着,改好后一个不留。
本地跑过上游 npm run check 的两半,scripts/validate.mjs 对本插件报 minimax-bot: OK 和 repository: OK,根目录 87/87 条测试;插件自带套件 279 过、0 挂,比上游 main 多 13 条。新加的 13 条用例搬到没改过的上游代码上跑,8 条红、5 条绿,那 5 条钉的是英文旧行为,前后都过,正好说明英文没被顺手改掉。正常内容下的提示词也逐字节比过:简报、记忆块、群上下文、拼起来的整段,四样都和上游一字不差。宿主自己往提示词里塞的标签(agent-context、media-output-reminder 之类)不在插件的协议标记范围内,Bot 原样抄进回话后会跟着群历史走进下一个 Bot 的提示词,这一条没管,要不要一起处理需要确认,我另开一条报上游。
Need help on this PR? Tag
@codesmith-botwith what you need.