Skip to content

fix(minimax-bot): 全角 @ 也能点到人,改群成员不再顺带换掉管理员 - #106

Open
Apageoflove wants to merge 7 commits into
MiniMax-AI:mainfrom
Apageoflove:fix/minimax-bot-mention-sign-admin-queue
Open

Apageoflove wants to merge 7 commits into
MiniMax-AI:mainfrom
Apageoflove:fix/minimax-bot-mention-sign-admin-queue

Conversation

@Apageoflove

@Apageoflove Apageoflove commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

这一版修四处:全角 @ 认不出点名、改群成员顺带换掉管理员、关停扔掉没开始的任务、台账把等待算成模型的。

输入法打出来的 @ 是全角的(U+FF20),小写的那个 ﹫(U+FE6B)也是同一个记号,中文默认输出的就是全角。点名的代码只扫半角的 @,所以用输入法打出来的点名谁也点不到,Bot 之间的交接同样断掉 —— #102 把 @ 前面的字按书写系统判过了,这两个记号还没算进去,这一版先归一化成半角再走同一套规则。

改群成员时顺带把管理员换掉这条路一直没过锁。显式改 admin 只让主 Bot 走,改 members 时把当前管理员漏掉,代码就静默把管理员换成名单里剩下第一个 —— 同一件事换个入口就没人管了。现在两扇门问同一个问题。

关停那会儿还没开始的任务也不该被扔掉。README 写的是重启之后没开始过的工作仍然排队,代码却不看任务有没有真的进过宿主就一律记成 unknown,而 unknown 取消不掉,工作等于没了。宿主已经接过去、结果没人能再观察到的照旧记 unknown,用户自己取消的照旧是取消。

台账的耗时把退避等待算成了模型的。模型两次调用之间要退避,那段等待原来算在这一回合的耗时里,于是模型实际跑了 52 毫秒的回合账上写着 28 秒,面板的平均照这个数走。耗时现在只算模型真在跑的时间,等待单记在 usage.jsonl 的 sleptMs 里,模型一次没跑的回合没有耗时可报,不进平均。

测试是四个新文件:mention-fullwidth-at、group-admin-transfer、task-shutdown-queue、ledger-retry-duration。插件自带套件 379 条全过,上游 npm run check 两半也过,这四个文件在未改的上游代码上是红的。

边界:只在 node 里直接驱动引擎验的,没有真实输入法、真实宿主和真实模型那一层,客户端里也没敲过键盘;关停那几条用的是优雅关停和从落盘状态重启,没做逐个写盘点的进程级 kill;群纪要、helper 依赖与队列的交互只做了旁读。这一版接在 #102 之后:全角半角与泰老柬缅那部分已经在 #102 里了,这里是它的收尾。


Autofix with [code]smith
Open in [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 rebasing on main. The code still looks good, and one README problem needs fixing before this can go in.

Must fix

  1. The rebase broke the README. README.md:79 has a leftover conflict marker (>>>>>>> slices/pr-next-m3/README.md), and after it about 140 lines are duplicated, from the 0.7.10 to 0.7.13 sections through "License". Please take README.md from main and add back only the 0.7.21 section.

Optional

  • README.md:73 ("Only a Bot may hand a group's admin over; the operator ... still may") is hard to parse. The code at team.mjs:428 means "only the main Bot or the operator may", so saying exactly that would be clearer.
  • callModel sets modelRan whenever invoke returns a value, but the comment above it says only turn.started proves the model ran. Make the comment and the code agree.
  • A short PR description listing the four fixes would help reviewers.

Verified

  • Version 0.7.21 matches in package.json, .minimax-plugin/plugin.json, the MCP serverInfo and the README heading.
  • npm run check passes on Node 22 at 2b05065, including the new plugin tests.
  • The GitHub check job is green.

@Apageoflove

Copy link
Copy Markdown
Contributor Author

README 那个问题是我的错:上一轮做三方合并时 README 实际是冲突的,我从带冲突标记的文件里截了 0.7.21 段再拼回 main,把标记和一段重复的尾巴一起带进去了。已经按你说的重做 —— README 取 main 的,只加回 0.7.21 那一段,位置在 0.7.20 之后、0.7.10 之前。查过了:没有冲突标记,0.7.10 段和 License 各只出现一次,标题没有重复,总行数 217。

还有一件事是我写正文时出的错:正文里的换行被当成字面的 \n 发出来了,所以在你那边整篇是一段字,看起来像一堵墙。这条也改好了,现在是正常分段,最前面加了一行把四条修复列出来。

admin 那句改成了「Only the main Bot or the operator may hand a group's admin over」,跟 team.mjs 里的实际判断一致。

callModel 那条我读代码之后选了让代码对上注释。注释说的对:宿主可以接受一个 answer 而不起续跑回合,这种情况下模型其实没跑,但 invoke 返回了值,于是 modelRan 被置真,台账给它记了一个凭空的时长。现在 modelRan 只由 turn.started 决定,callModel 只负责计时。差别只在「answer 被接受但没起回合」这一类回合:它们不再记时长,面板均值会略降,其余台账行为不变。「调用返回就算跑过」这个口径是仅个人判断,如果你们不认同,回退是一行改动。

门禁重跑:插件套件 379 条全过,上游 npm run check 两半也过。

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