Skip to content

Commit a603daf

Browse files
committed
fix(minimax-bot): the approval claim names the Host condition it depends on
1 parent 197b7a1 commit a603daf

5 files changed

Lines changed: 112 additions & 4 deletions

File tree

‎plugins/minimax-ai/minimax-bot/.minimax-plugin/plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"schemaVersion": 1,
33
"name": "minimax-bot",
44
"displayName": "MiniMax Bot",
5-
"version": "0.7.25",
5+
"version": "0.7.26",
66
"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.",
77
"author": "MiniMax Code",
88
"icon": "icon.png",

‎plugins/minimax-ai/minimax-bot/README.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ The hand-over between two Bots of a group carried the tail of the previous reply
9191
- A failure whose cause the plugin cannot read — a Host error it has no sentence for — now has a sentence of its own: the turn did not finish and the reason was not identified. Where the Host throws that error, the text it came with stays out of the chat, so a session id or a service name is not shown to the user. A Host that reports the failure as a result keeps showing the text it sent.
9292
- The errors the plugin raises itself keep the message they were built with, and every code it knows keeps its own sentence. No code was added or renamed, and nothing is retried differently: only the words a failed turn shows changed.
9393

94+
## 0.7.26 The approval claim names the Host condition it depends on
95+
96+
- The approval claim in **Agent turns** mixed the plugin's own behaviour with the Host's. The plugin never approves a call by itself — that part was true and stays true — but whether approval is asked for at all is decided by the Host's permission mode, and a Host that never asks for approval never shows the card. The old sentence stated the first half as if it also settled the second, so it read as a promise about an outcome the plugin does not control. It now names the Host condition, and keeps the plugin's own side: when approval is needed, the plugin never approves it by itself.
97+
9498
## 0.7.10 Optional group notes
9599

96100
- 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.
@@ -195,7 +199,7 @@ Avatars are stored in the Mini App's `dataDir/avatars/`. `GET /api/avatars` list
195199

196200
## Data & access
197201

198-
- **Agent turns**: every Bot reply, scheduled task and background job is an Agent turn run through `context.agent`, with the Agent's full capabilities (files, shell, Skills and MCP, including this plugin's own MCP tools). A tool call that needs approval is shown in the page or in the session's sidebar tab; it runs only after you choose **Allow once**. Nothing is approved automatically. A group with a relay limit spends one more Agent turn on the round that reaches the limit: the wrap-up, which replaces the blocked hand-off. A group note spends no turn at all: it is written from the replies the round already produced. Every turn is counted once in the usage panel, background jobs included.
202+
- **Agent turns**: every Bot reply, scheduled task and background job is an Agent turn run through `context.agent`, with the Agent's full capabilities (files, shell, Skills and MCP, including this plugin's own MCP tools). A tool call that needs approval is shown in the page or in the session's sidebar tab; it runs only after you choose **Allow once**. Whether a call needs approval at all is decided by the Host's permission mode; when it is needed, the plugin never approves it by itself. A group with a relay limit spends one more Agent turn on the round that reaches the limit: the wrap-up, which replaces the blocked hand-off. A group note spends no turn at all: it is written from the replies the round already produced. Every turn is counted once in the usage panel, background jobs included.
199203
- **Files written**: only inside the Mini App's `dataDir`: `state.json`, `messages/`, `usage.jsonl` (one row per Agent turn), `memory/` (including its journal, archive and backups), `uploads/` (your attachments) and `avatars/`. A group's note is part of that group's record in `state.json`, so it is removed with the group.
200204
- **Files read outside `dataDir`**:
201205
- `/api/media` serves a local file (up to 1 GiB) only when its absolute path appears in a Bot message of that same chat.

‎plugins/minimax-ai/minimax-bot/miniapp/node/mcp.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ export function createMcpHandler({ team, engine }) {
662662
result = {
663663
protocolVersion: PROTOCOL_VERSIONS.includes(requested) ? requested : PROTOCOL_VERSIONS[0],
664664
capabilities: { tools: { listChanged: false } },
665-
serverInfo: { name: 'minimax-bot', version: '0.7.25' },
665+
serverInfo: { name: 'minimax-bot', version: '0.7.26' },
666666
instructions: t('mcp.instructions'),
667667
};
668668
break;

‎plugins/minimax-ai/minimax-bot/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "minimax-bot",
3-
"version": "0.7.25",
3+
"version": "0.7.26",
44
"private": true,
55
"type": "module",
66
"mcode": {
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
// @ts-check
2+
// The approval claim in the README, written as executable assertions.
3+
//
4+
// The point of this file: the sentence that describes approval is checked, not read.
5+
//
6+
// 1. the Agent-turns bullet says the condition its claim depends on (the Host's
7+
// permission mode) and says what the plugin still guarantees — that when approval is
8+
// asked for it never approves by itself. Appending an "approved automatically"
9+
// qualifier while keeping the old promise fails, and so does flipping the claim to
10+
// "the plugin approves it by itself";
11+
// 2. the plugin version is one value in the manifest, in package.json and in the
12+
// serverInfo the MCP server reports, so no release ships as three different things;
13+
// 3. the README has a changelog entry for that version, after the 0.7.24 entry, with a
14+
// bullet of its own that talks about the approval claim — a renamed heading alone is
15+
// not an entry.
16+
17+
import assert from 'node:assert/strict';
18+
import { readFileSync } from 'node:fs';
19+
import { test } from 'node:test';
20+
import { join } from 'node:path';
21+
22+
const root = join(import.meta.dirname, '..');
23+
24+
/** @param {string} name */
25+
const readText = (name) => readFileSync(join(root, name), 'utf8');
26+
27+
/** @param {string} name */
28+
const readJson = (name) => JSON.parse(readText(name));
29+
30+
/**
31+
* The body of a numbered changelog section: its bullets, without the heading line, up to
32+
* the next `## ` heading.
33+
*
34+
* `heading` may be the start of a heading (`## 0.7.24 `) or its whole text including a
35+
* topic (`## 0.7.26 The approval claim`): a version number alone does not identify a
36+
* section, because two candidates can carry the same number and the first one found is
37+
* not necessarily the entry being checked.
38+
* @param {string} readme
39+
* @param {string} heading the heading prefix to match, e.g. `## 0.7.24 `
40+
*/
41+
function sectionOf(readme, heading) {
42+
const lines = readme.split('\n');
43+
const start = lines.findIndex((line) => line.startsWith(heading));
44+
assert.notEqual(start, -1, `README has no section starting with ${JSON.stringify(heading)}`);
45+
const next = lines.findIndex((line, index) => index > start && line.startsWith('## '));
46+
const end = next === -1 ? lines.length : next;
47+
return { at: start, heading: lines[start], body: lines.slice(start + 1, end).join('\n') };
48+
}
49+
50+
test('the Agent-turns bullet makes the approval claim conditional on the Host permission mode', () => {
51+
const readme = readText('README.md');
52+
const bullet = readme.split('\n').find((line) => line.startsWith('- **Agent turns**'));
53+
assert.ok(bullet, 'README has an Agent turns bullet');
54+
55+
// It has to name the condition its claim depends on, in the README's own words: the
56+
// Host decides whether approval is asked for at all.
57+
assert.match(bullet, /the Host's permission mode/i);
58+
// And it has to keep the plugin's own side of the claim, as the reviewed clause: when
59+
// approval is asked for, the plugin never approves it by itself.
60+
assert.match(bullet, /when it is needed, the plugin never approves it by itself/i);
61+
// The old unconditional promise must be gone, including the variants that phrase the
62+
// same promise ("nothing is ever approved automatically", "nothing gets approved ...").
63+
assert.doesNotMatch(bullet, /\bnothing (?:is|is ever|gets) (?:ever )?approved automatically\b/i);
64+
// And the claim must not be flipped: the plugin does not approve the call by itself.
65+
assert.doesNotMatch(bullet, /plugin approves (?:it|the call|a call) by itself/i);
66+
// Same guard in the words a later edit would actually reach for. The reviewed sentence
67+
// uses neither, so these cannot fire on the text this test is written for: nothing in
68+
// the bullet says a call is approved without a person, and nothing says the plugin can
69+
// approve one.
70+
assert.doesNotMatch(bullet, /\bautomatically\b/i);
71+
assert.doesNotMatch(bullet, /(?:can|may|will|would|does)\s+approve/i);
72+
});
73+
74+
test('the plugin version is the same value in the manifest, package.json and serverInfo', () => {
75+
const version = readJson('.minimax-plugin/plugin.json').version;
76+
assert.match(version, /^\d+\.\d+\.\d+$/);
77+
78+
assert.equal(readJson('package.json').version, version);
79+
80+
const server = readText('miniapp/node/mcp.mjs');
81+
const found = server.match(/serverInfo:\s*\{[^}]*version:\s*'([0-9]+\.[0-9]+\.[0-9]+)'/);
82+
assert.ok(found, 'mcp.mjs reports a serverInfo version');
83+
assert.equal(found[1], version);
84+
});
85+
86+
test('the README has a changelog entry for this version, after the 0.7.24 one', () => {
87+
const readme = readText('README.md');
88+
const version = readJson('.minimax-plugin/plugin.json').version;
89+
90+
const previous = sectionOf(readme, '## 0.7.24 ');
91+
// The release under review is found by its version alone, so a later release with a
92+
// topic of its own stays green.
93+
const current = sectionOf(readme, `## ${version} `);
94+
assert.ok(current.at > previous.at, `the ${version} entry comes after the 0.7.24 entry`);
95+
96+
// The approval claim is pinned to this release's own section, named literally: it is
97+
// this changelog entry that has to talk about it, not whichever section a later
98+
// version happens to put first. A renamed heading alone is not an entry either — the
99+
// approval claim has to be talked about in a bullet, not in the heading.
100+
const documented = sectionOf(readme, '## 0.7.26 ');
101+
const bullets = documented.body.split('\n').filter((line) => line.startsWith('- '));
102+
assert.ok(bullets.length >= 1, 'the 0.7.26 entry has at least one bullet, not just a heading');
103+
assert.match(bullets.join('\n'), /approval/u);
104+
});

0 commit comments

Comments
 (0)