From c56a10ef386211934c2b236e62bc2531c257186e Mon Sep 17 00:00:00 2001 From: EdgeMLHacker <126883848+Apageoflove@users.noreply.github.com> Date: Mon, 23 Nov 2026 01:30:00 -0500 Subject: [PATCH] =?UTF-8?q?fix(minimax-bot):=20=E4=B8=80=E8=BD=AE=E9=87=8C?= =?UTF-8?q?=E6=B2=A1=E4=BA=BA=E8=AF=B4=E8=AF=9D=E6=97=B6=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E6=8A=8A=20[PASS]=20=E5=BD=93=E6=88=90=E7=BB=93=E6=9E=9C?= 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 | 7 ++++ .../minimax-bot/miniapp/node/engine.mjs | 24 ++++++++++-- .../minimax-bot/miniapp/node/mcp.mjs | 2 +- plugins/minimax-ai/minimax-bot/package.json | 2 +- .../tests/engine-reliability.test.mjs | 37 +++++++++++++++++++ .../minimax-bot/tests/task-lifecycle.test.mjs | 20 ++++++++++ 7 files changed, 87 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 bdc8e0b7..c98f2705 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.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", diff --git a/plugins/minimax-ai/minimax-bot/README.md b/plugins/minimax-ai/minimax-bot/README.md index 857f7562..4183ebac 100644 --- a/plugins/minimax-ai/minimax-bot/README.md +++ b/plugins/minimax-ai/minimax-bot/README.md @@ -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. diff --git a/plugins/minimax-ai/minimax-bot/miniapp/node/engine.mjs b/plugins/minimax-ai/minimax-bot/miniapp/node/engine.mjs index 8342cc93..0e2168fc 100644 --- a/plugins/minimax-ai/minimax-bot/miniapp/node/engine.mjs +++ b/plugins/minimax-ai/minimax-bot/miniapp/node/engine.mjs @@ -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 @@ -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. @@ -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; diff --git a/plugins/minimax-ai/minimax-bot/miniapp/node/mcp.mjs b/plugins/minimax-ai/minimax-bot/miniapp/node/mcp.mjs index 0085b970..bdc9f9e4 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.34' }, + serverInfo: { name: 'minimax-bot', version: '0.7.35' }, instructions: t('mcp.instructions'), }; break; diff --git a/plugins/minimax-ai/minimax-bot/package.json b/plugins/minimax-ai/minimax-bot/package.json index 402077f4..a34e286d 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.34", + "version": "0.7.35", "private": true, "type": "module", "mcode": { diff --git a/plugins/minimax-ai/minimax-bot/tests/engine-reliability.test.mjs b/plugins/minimax-ai/minimax-bot/tests/engine-reliability.test.mjs index 6cf233f2..a00d8bc4 100644 --- a/plugins/minimax-ai/minimax-bot/tests/engine-reliability.test.mjs +++ b/plugins/minimax-ai/minimax-bot/tests/engine-reliability.test.mjs @@ -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); +}); diff --git a/plugins/minimax-ai/minimax-bot/tests/task-lifecycle.test.mjs b/plugins/minimax-ai/minimax-bot/tests/task-lifecycle.test.mjs index 68ac7591..5d52438f 100644 --- a/plugins/minimax-ai/minimax-bot/tests/task-lifecycle.test.mjs +++ b/plugins/minimax-ai/minimax-bot/tests/task-lifecycle.test.mjs @@ -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))); +});