Skip to content

feat(minimax-bot): 群纪要——清空聊天后群还记得说过什么(默认关闭) - #79

Merged
MyPrototypeWhat merged 1 commit into
MiniMax-AI:mainfrom
Apageoflove:feat/minimax-bot-group-note
Oct 26, 2026
Merged

MyPrototypeWhat merged 1 commit into
MiniMax-AI:mainfrom
Apageoflove:feat/minimax-bot-group-note

Conversation

@Apageoflove

@Apageoflove Apageoflove commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

给群加一份纪要,是群自己的字段,默认是关的:notes。开关在群设置里,模型改不了——MCP 的
update_group 里没有这个参数,模型即使硬塞也不生效;纪要的内容也只有插件能写,Bot 写不进去。

纪要记的是每轮结束时各 Bot 回复的结尾。它取自这一轮本来就有的回复,只是提示词里的一段文本,
不额外起模型回合、不额外调工具、不写记忆。群里每个 Bot 的常驻简报里都带上这份记录,所以每个
Bot 看到的是同一份。

纪要写在群资料里,不在消息里。这条是关键:群里"新建对话"清掉的是整群消息档案和会话游标,
群自己的记录(名字、公告、成员、接力设置)留着。纪要跟着群记录走,所以清空聊天之后还在,
后来加入的 Bot 也能读到。官方群里现在没有任何跨 Bot 的共享上下文——每个 Bot 只能拿到最近 30 条
群消息,而且只看得到别人的发言,群的共同记忆是一扇会被清空清掉的滑动窗,群设置却留着。

纪要是记录,不是共识:提示词里写明了,免得 Bot 把早先的话当成群里已经定了的事。面板里能看见
记了什么,也能清空。

为什么做这个:问题是我在本地测试里看出来的。我在 mcode 里对官方版跑过一套 8 步对照,群里
没有跨 Bot 的共享上下文,只有最近 30 条群消息这一扇窗;同一轮里官方的 Bot 为了还原"这个
标题是在什么上下文里定的"调了 6 次工具,翻会话列表、找草稿文件、读工作区。它缺的是群说过
的话的落点,这里补的正是这个落点。要说清楚的是:它不能凭空造出从没贴进群的素材——那几次
考古要找的有一部分正是这种素材;它保证的是群里已经说过的结论不会因为一次清空就消失。

测过什么:上游 npm run check 的两半都在本地跑了(scripts/validate.mjs 对本插件报
minimax-bot: OK 和 repository: OK,根目录 69/69 条测试);插件自带套件 251 过、0 挂(改前 236,
我给这个功能补了 15 条用例);开关关着时,群常驻简报中英文都和上游 main 逐字节相同,MCP 目录和
list_team 的返回也没变(与上游 main 6d1fb27 对照)。版本 0.7.9 → 0.7.10。

只在 linux-ubuntu-24.04 + MiniMax Code 3.1.4 上验证过,其他环境未验证。纪要这版是在插件自带的
测试里跑通的(测试用预置回复代替真实模型调用),没在桌面端用真模型跑过。


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.

Reviewed at 76e9b54.

Thanks, this is a tidy, well-scoped feature.

Optional

  1. Switching the note off keeps the old entries, hidden. team.mjs:378 only flips notes; noteEntries stays in the group record. The panel shows the entries and the Clear button only while the switch is on (panels.js:342), so after switching it off the user can't see or clear them, and switching it back on later puts the old lines straight back into every Bot's brief. Either clear noteEntries when the switch goes off, or keep the list and Clear button visible while entries exist. README.md:39 could also tell users that what was recorded is kept until they clear it.
  2. Comment at team.mjs:376-377. The comment at team.mjs:376 says switching off stops the hand-over, but hand-over has its own switch.
  3. Bot text is placed inside the standing brief. renderNote (group-note.mjs:150-160, injected at engine.mjs:419) puts reply tails inside <minimax-bot-context>. neutralizeMarks removes only the group-summary/handover marks, matched case-sensitively; it does not remove </minimax-bot-context> (engine.mjs:445), so a reply ending with that tag can appear to close the context block early. Consider adding the context marks to the forged-marks list (or escaping </> in note entries), and matching case-insensitively. The "record, not an agreement" heading is a good mitigation; this is defense in depth.
  4. The tail is cut after neutralizing (group-note.mjs:69-71). slice(-240) can start in the middle of a word or a partial tag. It's harmless, but trimming to a word boundary would read better.
  5. Prompt growth. Bounded at 6 entries / 1200 characters plus the heading and the two marks (group-note.mjs:35-42, bound() at 100-112), so about 1.4k characters at most per group brief. That's reasonable; it might help to state the limit in the panel hint so users know older rounds drop off.
  6. Panel renders the raw stored list (panels.js:345) instead of the bounded/cleaned noteEntries() that the brief uses. They match in normal use, but a hand-edited state file would show entries the Bots never see.

Notes

  • All data stays in the group record in state.json inside the Mini App's dataDir, is removed with the group, and the README's "Data & access" section is updated to say so.
  • With the switch off, prompts are unchanged: I built the standing brief (group chat and private chat, zh and en) and the MCP tools/list and list_team output on 6d1fb27 and on this head, with a group that has the switch off and a stale noteEntries value in its record. All eight outputs are byte-identical.
  • MCP: update_group / create_group map their arguments explicitly (mcp.mjs around 521-537), so a Bot can't pass notes or clearNotes. list_team doesn't expose the note.
  • Clear: clearNotes empties noteEntries (team.mjs:379). "Start new chat" keeps the note (intended), and deleting the group removes it.
  • No reading outside dataDir, and no access to host credentials or sessions, or to other plugins' data.
  • npm run check passes on Node 22 (minimax-bot: OK; 69/69 tests). The plugin's own tests pass: 251/251 on Node 22, including tests/group-note.test.mjs. Nothing was added to repo CI or the root test/.
  • Version 0.7.9 → 0.7.10 in plugin.json, package.json and the MCP serverInfo. Another open PR touching minimax-bot, #56, also edits the version lines (0.7.7 → 0.7.8, already behind main). Whichever merges second will need a rebase and a new version number.

@MyPrototypeWhat
MyPrototypeWhat merged commit bed662f into MiniMax-AI:main Oct 26, 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