From 5445cc26892bfa51a004799b7760bf7f87bc6e0f Mon Sep 17 00:00:00 2001 From: Evander Date: Tue, 24 Nov 2026 04:19:04 -0500 Subject: [PATCH 1/2] =?UTF-8?q?fix(minimax-bot):=20=E6=B2=A1=E5=A1=AB?= =?UTF-8?q?=E7=9A=84=E5=8F=AF=E9=80=89=E5=80=BC=E5=BD=93=E4=BD=9C=E6=B2=A1?= =?UTF-8?q?=E5=A1=AB=EF=BC=8C=E8=80=8C=E4=B8=8D=E6=98=AF=E5=BD=93=E6=88=90?= =?UTF-8?q?=E9=9D=9E=E6=B3=95=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../minimax-bot/.minimax-plugin/plugin.json | 2 +- plugins/minimax-ai/minimax-bot/README.md | 4 +++ .../minimax-bot/miniapp/node/mcp.mjs | 2 +- .../minimax-bot/miniapp/node/team.mjs | 9 +++--- plugins/minimax-ai/minimax-bot/package.json | 2 +- .../tests/enum-validation.test.mjs | 29 +++++++++++++++++++ 6 files changed, 41 insertions(+), 7 deletions(-) diff --git a/plugins/minimax-ai/minimax-bot/.minimax-plugin/plugin.json b/plugins/minimax-ai/minimax-bot/.minimax-plugin/plugin.json index 915018bd..370cee81 100644 --- a/plugins/minimax-ai/minimax-bot/.minimax-plugin/plugin.json +++ b/plugins/minimax-ai/minimax-bot/.minimax-plugin/plugin.json @@ -2,7 +2,7 @@ "schemaVersion": 1, "name": "minimax-bot", "displayName": "MiniMax Bot", - "version": "0.7.39", + "version": "0.7.40", "description": "Turn MiniMax Code into an always-on team of Bots. A Chief Bot helps you build the team; in group chats the admin answers and @mentions hand work to other members. Every Bot has its own octopus avatar and memory, with scheduled tasks and usage stats.", "author": "MiniMax Code", "icon": "icon.png", diff --git a/plugins/minimax-ai/minimax-bot/README.md b/plugins/minimax-ai/minimax-bot/README.md index c022ed8c..72fa6071 100644 --- a/plugins/minimax-ai/minimax-bot/README.md +++ b/plugins/minimax-ai/minimax-bot/README.md @@ -160,6 +160,10 @@ The hand-over between two Bots of a group carried the tail of the previous reply - The text that rides into the next Bot's prompt is cleaned of the marks a reply may not forge. The cleaning walked the text one code unit at a time, so a character that needs two units — one of the tag characters or the variation selectors in the Supplementary Multilingual Plane — was never recognised as the character that takes no space, and a mark split by one stayed a mark. - `` reached the next Bot whole: the closing tag of the block the plugin writes around the context. The words around it were kept, as they are for every other spelling. - The text is now walked by code point, so a character outside the Basic Multilingual Plane is read as the one character it is. The tag characters are named as well, because some of the slots in that block are not assigned in every Unicode version and are therefore not caught by the general categories. +## 0.7.40 A value that is not there is left out, not refused + +- The reply mode of a group and the kind of a scheduled task are checked against the values the catalogue offers, so a value that is not one of them is refused instead of quietly becoming another one. A value that is not there at all was refused too, when it arrived as null: many models write an optional field they did not fill in as null, and the call failed with "reply_mode must be one of: admin, all". +- A null is now read as what it is — a field that was left out — so the default applies, the same as when the field is absent. A value that is there but is not one of the allowed ones is still refused, and so is the text "null". ## 0.7.10 Optional group notes diff --git a/plugins/minimax-ai/minimax-bot/miniapp/node/mcp.mjs b/plugins/minimax-ai/minimax-bot/miniapp/node/mcp.mjs index 5e0c520a..a6473f79 100644 --- a/plugins/minimax-ai/minimax-bot/miniapp/node/mcp.mjs +++ b/plugins/minimax-ai/minimax-bot/miniapp/node/mcp.mjs @@ -662,7 +662,7 @@ export function createMcpHandler({ team, engine }) { result = { protocolVersion: PROTOCOL_VERSIONS.includes(requested) ? requested : PROTOCOL_VERSIONS[0], capabilities: { tools: { listChanged: false } }, - serverInfo: { name: 'minimax-bot', version: '0.7.39' }, + serverInfo: { name: 'minimax-bot', version: '0.7.40' }, instructions: t('mcp.instructions'), }; break; diff --git a/plugins/minimax-ai/minimax-bot/miniapp/node/team.mjs b/plugins/minimax-ai/minimax-bot/miniapp/node/team.mjs index d9b212ef..7869b822 100644 --- a/plugins/minimax-ai/minimax-bot/miniapp/node/team.mjs +++ b/plugins/minimax-ai/minimax-bot/miniapp/node/team.mjs @@ -372,7 +372,7 @@ export class Team { notice: String(input.notice ?? '').trim().slice(0, 500), adminId, memberIds, - replyMode: input.replyMode === undefined ? 'admin' : replyModeOf(input.replyMode), + replyMode: input.replyMode == null ? 'admin' : replyModeOf(input.replyMode), pinned: false, createdAt: Date.now(), // F7 · the relay guardrails. The hop limit counts how many Bots may speak in one relay @@ -419,7 +419,7 @@ export class Team { const draft = { ...group, memberIds: [...group.memberIds] }; if (patch.name !== undefined) draft.name = this.validateName(patch.name, 'group', group.id); if (patch.notice !== undefined) draft.notice = String(patch.notice).trim().slice(0, 500); - if (patch.replyMode !== undefined) draft.replyMode = replyModeOf(patch.replyMode); + if (patch.replyMode != null) draft.replyMode = replyModeOf(patch.replyMode); if (patch.pinned !== undefined) draft.pinned = Boolean(patch.pinned); // The relay guardrails: absent leaves the group's own setting alone. 0 = no limit. if (patch.maxHops !== undefined) draft.maxHops = hopLimit({ maxHops: patch.maxHops }); @@ -593,8 +593,9 @@ export class Team { const list = this.store.state.schedules; const existing = input.id ? list.find((s) => s.id === input.id) : undefined; // No kind at all is the daily default. A kind that is not one of the three is refused: - // another kind would run at a time the user never asked for. - const kind = input.kind === undefined ? 'daily' : scheduleKindOf(input.kind); + // another kind would run at a time the user never asked for. A kind that is not there at + // all — left out, or sent as null — is the same thing as leaving it out. + const kind = input.kind == null ? 'daily' : scheduleKindOf(input.kind); const time = String(input.time ?? '09:00'); if (kind === 'daily' && !/^([01]\d|2[0-3]):[0-5]\d$/.test(time)) { throw new EngineError('invalid', t('err.scheduleTime')); diff --git a/plugins/minimax-ai/minimax-bot/package.json b/plugins/minimax-ai/minimax-bot/package.json index 56878589..e799ef2e 100644 --- a/plugins/minimax-ai/minimax-bot/package.json +++ b/plugins/minimax-ai/minimax-bot/package.json @@ -1,6 +1,6 @@ { "name": "minimax-bot", - "version": "0.7.39", + "version": "0.7.40", "private": true, "type": "module", "mcode": { diff --git a/plugins/minimax-ai/minimax-bot/tests/enum-validation.test.mjs b/plugins/minimax-ai/minimax-bot/tests/enum-validation.test.mjs index 1825a5f3..99a2b4c1 100644 --- a/plugins/minimax-ai/minimax-bot/tests/enum-validation.test.mjs +++ b/plugins/minimax-ai/minimax-bot/tests/enum-validation.test.mjs @@ -273,3 +273,32 @@ test('the refusals are written in the user\'s language', async (t) => { (error) => { assert.equal(error.code, 'invalid'); assert.match(error.message, /admin/); return true; }, ); }); + +test('a value that is not there at all is left out, not refused', async (t) => { + const { team } = await teamFixture(t); + const bot = await writer(team); + // A model that leaves an optional field out often writes it as null. That is the same as + // leaving it out, so the default applies. A value that is there but wrong is still refused. + const group = await team.createGroup(undefined, { name: 'NullMode', members: [bot.id], replyMode: null }); + assert.equal(group.replyMode, 'admin', 'the default applies to a reply mode sent as null'); + const schedule = await team.saveSchedule({ botId: bot.id, prompt: 'Daily digest', kind: null }); + assert.equal(schedule.kind, 'daily', 'the default applies to a kind sent as null'); + + // A value that is there but not one of the allowed ones is still refused. + await assert.rejects( + () => team.createGroup(undefined, { name: 'WrongMode', members: [bot.id], replyMode: 'everyone' }), + (error) => { assert.equal(error.code, 'invalid'); return true; }, + ); + await assert.rejects( + () => team.saveSchedule({ botId: bot.id, prompt: 'Report', kind: 'hourly' }), + (error) => { assert.equal(error.code, 'invalid'); return true; }, + ); +}); + +test('a reply mode sent as null leaves an existing group with the setting it had', async (t) => { + const { team } = await teamFixture(t); + const bot = await writer(team); + const group = await team.createGroup(undefined, { name: 'Crew', members: [bot.id], replyMode: 'all' }); + const updated = await team.updateGroup(undefined, group.id, { replyMode: null }); + assert.equal(updated.replyMode, 'all', 'the mode the group had is kept'); +}); From 58db9a585c84a70ade091dc497a745dd0f8a6393 Mon Sep 17 00:00:00 2001 From: Evander Date: Sun, 29 Nov 2026 21:30:07 -0500 Subject: [PATCH 2/2] =?UTF-8?q?fix(minimax-bot):=20reply=20mode=20?= =?UTF-8?q?=E7=9A=84=20'null'=20=E4=B9=9F=E6=96=AD=E8=A8=80=E4=B8=BA?= =?UTF-8?q?=E6=8B=92=E7=BB=9D=EF=BC=8CREADME=20=E8=A1=A5=E7=A9=BA=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/minimax-ai/minimax-bot/README.md | 1 + .../tests/enum-validation.test.mjs | 22 ++++++++++--------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/plugins/minimax-ai/minimax-bot/README.md b/plugins/minimax-ai/minimax-bot/README.md index 72fa6071..651f680a 100644 --- a/plugins/minimax-ai/minimax-bot/README.md +++ b/plugins/minimax-ai/minimax-bot/README.md @@ -160,6 +160,7 @@ The hand-over between two Bots of a group carried the tail of the previous reply - The text that rides into the next Bot's prompt is cleaned of the marks a reply may not forge. The cleaning walked the text one code unit at a time, so a character that needs two units — one of the tag characters or the variation selectors in the Supplementary Multilingual Plane — was never recognised as the character that takes no space, and a mark split by one stayed a mark. - `` reached the next Bot whole: the closing tag of the block the plugin writes around the context. The words around it were kept, as they are for every other spelling. - The text is now walked by code point, so a character outside the Basic Multilingual Plane is read as the one character it is. The tag characters are named as well, because some of the slots in that block are not assigned in every Unicode version and are therefore not caught by the general categories. + ## 0.7.40 A value that is not there is left out, not refused - The reply mode of a group and the kind of a scheduled task are checked against the values the catalogue offers, so a value that is not one of them is refused instead of quietly becoming another one. A value that is not there at all was refused too, when it arrived as null: many models write an optional field they did not fill in as null, and the call failed with "reply_mode must be one of: admin, all". diff --git a/plugins/minimax-ai/minimax-bot/tests/enum-validation.test.mjs b/plugins/minimax-ai/minimax-bot/tests/enum-validation.test.mjs index 99a2b4c1..e5960be9 100644 --- a/plugins/minimax-ai/minimax-bot/tests/enum-validation.test.mjs +++ b/plugins/minimax-ai/minimax-bot/tests/enum-validation.test.mjs @@ -170,15 +170,17 @@ test('the declared kinds are still accepted', async (t) => { test('an unknown reply mode is refused when a group is created', async (t) => { const { team, store } = await teamFixture(t); const bot = await writer(team); - await assert.rejects( - () => team.createGroup(undefined, { name: 'Crew', members: [bot.id], replyMode: 'ALL' }), - (error) => { - assert.equal(error.code, 'invalid'); - assert.match(error.message, /admin/); - assert.match(error.message, /all/); - return true; - }, - ); + for (const replyMode of ['ALL', 'null']) { + await assert.rejects( + () => team.createGroup(undefined, { name: 'Crew', members: [bot.id], replyMode }), + (error) => { + assert.equal(error.code, 'invalid'); + assert.match(error.message, /admin/); + assert.match(error.message, /all/); + return true; + }, + ); + } assert.deepEqual(store.state.groups, [], 'no group was created'); }); @@ -187,7 +189,7 @@ test('a refused reply mode leaves the group with the setting it had', async (t) const bot = await writer(team); const group = await team.createGroup(undefined, { name: 'Crew', members: [bot.id], replyMode: 'all' }); assert.equal(group.replyMode, 'all'); - for (const replyMode of ['ALL', 'everyone', ' all', 'Admin', '']) { + for (const replyMode of ['ALL', 'everyone', ' all', 'Admin', '', 'null']) { await assert.rejects( () => team.updateGroup(undefined, group.id, { replyMode }), (error) => { assert.equal(error.code, 'invalid', `replyMode=${JSON.stringify(replyMode)}`); return true; },