Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/minimax-ai/minimax-bot/.minimax-plugin/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions plugins/minimax-ai/minimax-bot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ The hand-over between two Bots of a group carried the tail of the previous reply
- `</minimax-bot` followed by U+E0020 and `-context>` 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

- A group can keep a note of what it said. After every round the group records the closing lines of the replies, and every Bot of the group gets that record in its standing brief.
Expand Down
2 changes: 1 addition & 1 deletion plugins/minimax-ai/minimax-bot/miniapp/node/mcp.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 5 additions & 4 deletions plugins/minimax-ai/minimax-bot/miniapp/node/team.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 });
Expand Down Expand Up @@ -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'));
Expand Down
2 changes: 1 addition & 1 deletion plugins/minimax-ai/minimax-bot/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "minimax-bot",
"version": "0.7.39",
"version": "0.7.40",
"private": true,
"type": "module",
"mcode": {
Expand Down
51 changes: 41 additions & 10 deletions plugins/minimax-ai/minimax-bot/tests/enum-validation.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});

Expand All @@ -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; },
Expand Down Expand Up @@ -273,3 +275,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');
});