diff --git a/plugins/minimax-ai/minimax-bot/.minimax-plugin/plugin.json b/plugins/minimax-ai/minimax-bot/.minimax-plugin/plugin.json index 7e5cc956..5bae125d 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.32", + "version": "0.7.36", "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 dcaf8d60..e6fbb873 100644 --- a/plugins/minimax-ai/minimax-bot/README.md +++ b/plugins/minimax-ai/minimax-bot/README.md @@ -116,6 +116,11 @@ The hand-over between two Bots of a group carried the tail of the previous reply - Two writes the plugin fires and forgets had nothing to catch their failure: the session id recorded when a turn starts, and the scheduled-task scan that runs every 30 seconds. A failed write there became an unhandled rejection, and the Host fails the whole Mini App process on one of those — so a disk that would not take a write took every running turn with it, and the scheduled task kept retrying every 30 seconds. - Both now report the failure through the plugin log, the way the task save next to one of them already did. The turn carries on, and the scan keeps running. +## 0.7.36 A shortened task result says that it was shortened + +- The report a finished task batch hands back was trimmed to 4,000 characters per task without saying so. The task record already carries a marker when it had to shorten a result itself, and the report did not consult it, so a reader had no way to tell "this is the whole answer" from "this is the first part of it". +- A result that was cut now ends with the same truncation mark the rest of the plugin uses. A result that fits is unchanged, and the full text is still read back with `get_tasks`. + ## 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/mcp.mjs b/plugins/minimax-ai/minimax-bot/miniapp/node/mcp.mjs index f6c660f0..8a836bdd 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.32' }, + serverInfo: { name: 'minimax-bot', version: '0.7.36' }, instructions: t('mcp.instructions'), }; break; diff --git a/plugins/minimax-ai/minimax-bot/miniapp/node/task-dispatcher.mjs b/plugins/minimax-ai/minimax-bot/miniapp/node/task-dispatcher.mjs index 8fd3339d..c6970ea3 100644 --- a/plugins/minimax-ai/minimax-bot/miniapp/node/task-dispatcher.mjs +++ b/plugins/minimax-ai/minimax-bot/miniapp/node/task-dispatcher.mjs @@ -201,7 +201,13 @@ export class TaskDispatcher { batchReport(batch) { return reportBody(t("task.results", { id: batch.id }) + "\n" + batch.tasks.map((task) => { - const report = `${this.store.getBot(task.botId)?.name ?? task.title} [${task.status}] (${task.id})\n${clip(task.result || task.error || "-", 4000)}`; + const stored = String(task.result || task.error || "-"); + // The report carries the first part of each result. Saying so matters: the task record may + // already hold a shortened copy (`resultTruncated`), and this window is shorter still, so a + // reader who is not told would take the cut for the end of the work. + const shown = clip(stored, 4000); + const cut = shown.length < stored.length || task.resultTruncated; + const report = `${this.store.getBot(task.botId)?.name ?? task.title} [${task.status}] (${task.id})\n${shown}${cut ? `\n${t("clip.truncated")}` : ""}`; // An unconfirmed outcome has no output to show: say so instead of a bare status code. return task.status === "unknown" ? `${report}\n${t("task.unknownOutcome")}` : report; }).join("\n\n")); diff --git a/plugins/minimax-ai/minimax-bot/package.json b/plugins/minimax-ai/minimax-bot/package.json index acc9773b..a297a586 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.32", + "version": "0.7.36", "private": true, "type": "module", "mcode": { 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 26dc4b85..b5e762e2 100644 --- a/plugins/minimax-ai/minimax-bot/tests/task-lifecycle.test.mjs +++ b/plugins/minimax-ai/minimax-bot/tests/task-lifecycle.test.mjs @@ -1033,3 +1033,27 @@ for (const continuation of ["questionnaire", "dependency verification"]) { await recoveredStore.writeChain; }); } + +test("a report that had to shorten a result says so", async (t) => { + const { engine } = await fixture(t); + const long = "x".repeat(9000); + const batch = { + id: "batch_clip", + tasks: [ + // Longer than the report window and already shortened in the record: both are silent cuts. + { id: "task_long", botId: "bot_b", status: "done", result: long.slice(0, 8000), resultTruncated: true }, + // Longer than the report window only. + { id: "task_window", botId: "bot_b", status: "done", result: long.slice(0, 5000) }, + // Short enough: nothing was cut, so nothing is said. + { id: "task_short", botId: "bot_b", status: "done", result: "All good" }, + ], + }; + + const report = engine.tasks.batchReport(batch); + const [longPart, windowPart, shortPart] = report.split("\n\n"); + + assert.ok(longPart.includes("(truncated)"), "a result shortened in the record says so"); + assert.ok(windowPart.includes("(truncated)"), "a result longer than the report window says so"); + assert.ok(!shortPart.includes("(truncated)"), "a result that fits is not marked"); + assert.ok(shortPart.includes("All good"), "a short result is still shown in full"); +});