diff --git a/plugins/minimax-ai/minimax-bot/.minimax-plugin/plugin.json b/plugins/minimax-ai/minimax-bot/.minimax-plugin/plugin.json index 12fa8746..bdc8e0b7 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.33", + "version": "0.7.34", "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 c2fbd553..857f7562 100644 --- a/plugins/minimax-ai/minimax-bot/README.md +++ b/plugins/minimax-ai/minimax-bot/README.md @@ -122,6 +122,11 @@ The hand-over between two Bots of a group carried the tail of the previous reply - Stopping before the run exists now marks the task stopped and saves that, and a task already marked stopped no longer starts a background turn. - A task that had already started is unchanged: it is stopped by aborting its run, as before. +## 0.7.34 A retry that succeeds clears the "not delivered" line it answers + +- 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.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 8a1ead05..8342cc93 100644 --- a/plugins/minimax-ai/minimax-bot/miniapp/node/engine.mjs +++ b/plugins/minimax-ai/minimax-bot/miniapp/node/engine.mjs @@ -1483,6 +1483,19 @@ export class Engine { this.broadcast({ type: 'message.upsert', chatId, message }); const run = async () => { const result = await this.runBotTurn({ bot, chatId, text, kind: group ? 'group' : message.kind ?? 'private' }); + // The retry answers the same request, so the input it belongs to is delivered now. Without + // this the user's line keeps the failed badge the first attempt set, and reads as "not sent" + // next to a reply that did arrive. + if (result.accepted && message.sourceMessageId) { + const history = await this.store.getMessages(chatId); + const input = history.find((m) => m.id === message.sourceMessageId); + // Only a line that still carries the first attempt's verdict: a later state (a newer + // supplement, a cancel) outranks this retry and must not be overwritten. + if (input && (input.dispatchState === 'failed' || input.dispatchState === 'uncertain')) { + await this.store.updateMessage(chatId, input.id, { dispatchState: 'delivered' }); + this.broadcast({ type: 'message.upsert', chatId, message: input }); + } + } if (!group || result.status !== 'done' || result.pendingQuestion || PASS_RE.test(result.text)) return; const next = this.mentionsIn(result.text, group, bot.id); if (next.length) await this.driveGroup(group, next); diff --git a/plugins/minimax-ai/minimax-bot/miniapp/node/mcp.mjs b/plugins/minimax-ai/minimax-bot/miniapp/node/mcp.mjs index 83610206..0085b970 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.33' }, + serverInfo: { name: 'minimax-bot', version: '0.7.34' }, instructions: t('mcp.instructions'), }; break; diff --git a/plugins/minimax-ai/minimax-bot/package.json b/plugins/minimax-ai/minimax-bot/package.json index a4548754..402077f4 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.33", + "version": "0.7.34", "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 1fafd72d..6cf233f2 100644 --- a/plugins/minimax-ai/minimax-bot/tests/engine-reliability.test.mjs +++ b/plugins/minimax-ai/minimax-bot/tests/engine-reliability.test.mjs @@ -1427,3 +1427,32 @@ test('stopping a helper while its admission is still being saved stops it for go assert.equal(store.state.helpers.find((helper) => helper.id === queued.id).status, 'stopped'); assert.equal(runs, 1); }); + +test('a successful retry marks the request it answered as delivered', async (t) => { + const { store, engine } = await fixture(t); + const bot = store.state.bots[0]; + const chatId = `bot:${bot.id}`; + engine.agent = { async run(input, options) { + return { ...started(input, options, 'retry-reply'), status: 'finished', text: 'The answer' }; + } }; + // The first attempt failed and left its verdict on the user's line. + const user = await store.appendMessage(chatId, { + role: 'user', text: 'Do the thing', clientMessageId: 'retry-1', + clientMessageHash: engine.userMessageFingerprint('Do the thing', []), dispatchState: 'failed', + }); + const failed = await store.appendMessage(chatId, { + role: 'bot', botId: bot.id, text: '', status: 'error', sourceMessageId: user.id, + retryable: true, retryInput: 'Do the thing', errorCode: 'agent_unavailable', + }); + await store.writeChain; + + await engine.retryMessage(chatId, failed.id); + await until(() => idle(engine)); + await new Promise((resolve) => setTimeout(resolve, 60)); + + // The retry answered the same request, so its line is delivered now, not still "not sent". + const input = (await store.getMessages(chatId)).find((message) => message.id === user.id); + assert.equal(input.dispatchState, 'delivered'); + engine.dispose(); + await store.writeChain; +});