Skip to content
Open
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.34",
"version": "0.7.35",
"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
7 changes: 7 additions & 0 deletions plugins/minimax-ai/minimax-bot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ The hand-over between two Bots of a group carried the tail of the previous reply
- When a turn failed, the user's message kept the failed delivery state even after the reply was retried successfully: the chat showed a reply next to an input still marked as not delivered, and the line stayed that way for good.
- A retry that reaches the Host now marks the request it answered as delivered, so the badge matches what happened. Only a line still carrying the first attempt's verdict is changed; anything a later action wrote stays as it is.

## 0.7.35 A round of passes does not hand [PASS] back as its outcome

- When a member of a group has nothing to add it replies `[PASS]` and is skipped. That turn was still kept as the round's result, so a discussion that ended on a pass reported `[PASS]` as what it produced. A group task opened from a private chat showed exactly that in its result line.
- It was worse when an earlier member had said something real: the last pass replaced the round's text with `[PASS]`, so the work that was actually done was dropped from the result and only the chat still had it.
- A pass is no longer kept as the round's result, so a round that ends on a pass keeps the last thing that was really said. The pass itself is still marked and still skipped: nothing changes about who speaks.
- A round in which every member passed still finished, so it ends as a finished round with an empty reply — not as a turn that never reached the Agent. Before this section, such a round settled its task as `cancelled`; it settles as `done` now.

## 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
24 changes: 20 additions & 4 deletions plugins/minimax-ai/minimax-bot/miniapp/node/engine.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@ function skippedTurn() {
return { status: 'aborted', text: '', messageId: '', skipped: true, safeToContinue: true, accepted: false };
}

/**
* Result of a round that ran to the end without producing any text: every member that was called
* passed. The round did finish, so this is a finished turn with an empty reply — not a turn that
* never reached the Agent, which would settle a group task as cancelled.
*/
function quietTurn() {
return { status: 'done', text: '', messageId: '', safeToContinue: true, accepted: true };
}

/**
* Answer failures raised before the Host saved the answer: the questionnaire is still pending,
* so the user may submit it again. Anything else (notably AGENT_OUTCOME_UNKNOWN) may already
Expand Down Expand Up @@ -1333,18 +1342,21 @@ export class Engine {
const handover = this.handoverFor(fresh, noteRound);
hops += 1;
const result = await this.runBotTurn({ bot, chatId, text: '', kind: 'group', sourceMessageId, sourceMessageIds, signal: options.signal, taskId: options.taskId, handover });
lastResult = result;
accepted ||= result.accepted;
if (result.status === 'aborted' && (options.signal?.aborted || loop.cancelled)) queue.unshift(botId);
if (result.safeToContinue === false) break;
if (result.safeToContinue === false) { lastResult = result; break; }
// Resume this member's verification under the same task before advancing the group.
if (result.status === 'done' && result.waitingForTasks) break;
if (result.status === 'done' && result.waitingForTasks) { lastResult = result; break; }
if (result.status === 'done' && !result.pendingQuestion && PASS_RE.test(result.text)) {
await this.store.updateMessage(chatId, result.messageId, { status: 'pass' });
const updated = (await this.store.getMessages(chatId)).find((m) => m.id === result.messageId);
this.broadcast({ type: 'message.upsert', chatId, message: updated });
// A member that passes said nothing, so its turn is not the round's result: a round
// that ends on a pass hands over the last thing that was really said, not `[PASS]`.
// `lastResult` therefore keeps whatever the round produced before this pass.
continue;
}
lastResult = result;
if (result.status === 'error' && !loop.cancelled) {
// One member could not reply (its error and a retry button are in the chat): the round
// goes on. If nobody else is queued, the admin picks it up so the user is not left hanging.
Expand Down Expand Up @@ -1390,7 +1402,11 @@ export class Engine {
this.broadcastSummary(chatId);
}
if (!paused && loop.cancelled && queue.length) paused = 'interrupted';
return { ...(lastResult ?? skippedTurn()), accepted, paused, remaining: [...queue] };
// A round where every turn that ran only passed has no text to hand over, but it did run
// to the end: report it as a finished turn with an empty reply rather than as a turn that
// never reached the Agent, which settles a group task as cancelled instead of done.
const everybodyPassed = !lastResult && hops > 0;
return { ...(lastResult ?? (everybodyPassed ? quietTurn() : skippedTurn())), accepted, paused, remaining: [...queue] };
} finally {
if (this.groupLoops.get(chatId) === loop) this.groupLoops.delete(chatId);
loop.cancelled = true;
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.34' },
serverInfo: { name: 'minimax-bot', version: '0.7.35' },
instructions: t('mcp.instructions'),
};
break;
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.34",
"version": "0.7.35",
"private": true,
"type": "module",
"mcode": {
Expand Down
37 changes: 37 additions & 0 deletions plugins/minimax-ai/minimax-bot/tests/engine-reliability.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1456,3 +1456,40 @@ test('a successful retry marks the request it answered as delivered', async (t)
engine.dispose();
await store.writeChain;
});

test('a group round whose members pass does not report a pass as its outcome', async (t) => {
const { store, engine } = await fixture(t);
const { a, chatId } = groupFixture(store);
// The only member to speak passes: the round produced nothing, so there is nothing to report.
engine.agent = { async run(input, options) {
return { ...started(input, options, 'pass-session'), status: 'finished', text: '[PASS]' };
} };

const result = await engine.driveGroup(store.state.groups[0], [a.id], undefined);

assert.equal(result.text, '', 'a round that only passed has no outcome to hand over');
assert.equal(result.status, 'done', 'the round finished; it was not a turn that never ran');
assert.doesNotMatch(String(result.text ?? ''), /PASS/i);
const messages = await store.getMessages(chatId);
assert.equal(messages.filter((message) => message.status === 'pass').length, 1, 'the pass is still recorded in the chat');
});

test('a pass by the last speaker does not overwrite what an earlier one said', async (t) => {
const { store, engine } = await fixture(t);
const { a, b, chatId } = groupFixture(store);
store.state.groups[0].memberIds = [a.id, b.id];
// Alice speaks, Bob adds nothing: the round's outcome is Alice's text, not Bob's pass.
engine.agent = { async run(input, options) {
const alice = input.text.includes("It's your turn (Alice)");
return { ...started(input, options, alice ? 'a-session' : 'b-session'), status: 'finished',
text: alice ? '@Bob take a look' : '[PASS]' };
} };

const result = await engine.driveGroup(store.state.groups[0], [a.id], undefined);

assert.equal(result.text, '@Bob take a look');
assert.equal(result.status, 'done');
assert.doesNotMatch(String(result.text ?? ''), /PASS/i);
const messages = await store.getMessages(chatId);
assert.equal(messages.filter((message) => message.status === 'pass').length, 1);
});
20 changes: 20 additions & 0 deletions plugins/minimax-ai/minimax-bot/tests/task-lifecycle.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1035,3 +1035,23 @@ for (const continuation of ["questionnaire", "dependency verification"]) {
await recoveredStore.writeChain;
});
}

test("a discussion in which every member passes finishes as done with an empty result", async (t) => {
const { engine, store, group } = await fixture(t);
// Every member that is called has nothing to add.
engine.agent = { async run(input, options) { return agentResult(input, options, "[PASS]"); } };

await engine.tasks.dispatch(undefined, { request_id: "all-pass", group: group.id, message: "Anything to add?" }, undefined, true);
await until(() => idle(engine));

const task = engine.tasks.tasks[0];
// The round ran to the end: nothing was cancelled, and no work is left waiting.
assert.equal(task.status, "done", `task ended as ${task.status}`);
assert.equal(task.result, "");
assert.equal(task.error, undefined);
assert.equal(task.remainder?.length ?? 0, 0);
// The passes themselves are still recorded, and still marked as such.
const passes = (await store.getMessages(`group:${group.id}`)).filter((message) => message.status === "pass");
assert.ok(passes.length >= 1, "the member's pass is still in the chat, marked as a pass");
assert.ok(passes.every((message) => /^\s*\[?PASS\]?\s*[.。]?\s*$/i.test(message.text)));
});