Skip to content

fix(minimax-bot): 失败的回合说清是哪一种失败 - #122

Merged
MyPrototypeWhat merged 1 commit into
MiniMax-AI:mainfrom
Apageoflove:fix/minimax-bot-agent-error-copy
Nov 10, 2026
Merged

MyPrototypeWhat merged 1 commit into
MiniMax-AI:mainfrom
Apageoflove:fix/minimax-bot-agent-error-copy

Conversation

@Apageoflove

@Apageoflove Apageoflove commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

这个 PR 只做一件事:把失败回合显示的那句话改掉,让它说清发生了什么,而不是笼统地说"try again shortly"。挑出这句话的分支也跟着改了一点。

10-22 那条评审要一份复现,allturk 当天就给了:宿主日志是 legacy_fallback(0.6.12、macOS、0.7.7),几个入口都在 stage=create-session 上失败,管理面一直正常,本地打上 0.7.8 之后回合 status=done。10-23 那条回的是 Mini App 放着不动之后 MCP 连接掉下去那半截,跟这里无关。

Agent 没能起来的回合,现在会说是 Agent 没起来、这一轮没跑、下一步该试什么,依据是 docs/agent.md 对 AGENT_UNAVAILABLE 的写法。插件读不懂原因的那类失败,现在有自己的句子,不再把宿主原文直接摆出来,说这一轮没能完成、原因没能确认。宿主那段文字随后就不见了。回合路径本来就没把它写进日志,改前改后都没有,存下来的消息只留宿主的错误码、不留那段话,所以 session id 或服务名不会出现在聊天里。这一半其实超出了他点的名,是拿诊断信息换界面干净;如果他更想保留宿主原文,撤掉这一半也可以,"Agent 没起来"那句并不依赖它。宿主以结果形式回报失败、而不是抛出来的时候,仍然显示它自己发的那句话。插件自己抛的错误保留自己的 message,已知的错误码各自保留自己的句子。

没有动绑定逻辑,没有动重试语义,没有新增或改名任何错误码。

改了这些文件。

  • miniapp/node/strings.mjs 中英文新句子,外加只在服务端出现的 agentError.hostError,页面不查这个键
  • miniapp/client/strings-app.js 与服务端逐字相同的 agentError.AGENT_UNAVAILABLE
  • miniapp/node/engine.mjs 里 describeAgentError 三步回落,已知码、插件自己的错误消息、宿主那句
  • tests/agent-error-copy.test.mjs 新增,14 条断言
  • README.md 的一节 0.7.25
  • package.json、.minimax-plugin/plugin.json、miniapp/node/mcp.mjs 三处版本 0.7.24 改到 0.7.25

测法是插件目录里 npm ci --prefix tests --ignore-scripts --no-audit --no-fund 然后 node --test tests/*.test.mjs,46 个文件 408 条全过,新加的 14 条也在里面。这份新测试在改之前的代码上是红的,14 条里挂 6 条,不是那种怎么都过的测试。仓库根的 npm ci && npm run check 在干净克隆上也是绿的。

测试环境(Tested environment)

MiniMax Code 3.1.2(macOS 与 Windows)与 MiniMax Code 3.1.4(Linux),是这个包 README 里已经写明的环境。这次只改措辞,不需要更新的客户端,这里也没有对着真实宿主跑过。

数据与权限(Data & access)

没有变化。这份 PR 不新增任何文件读、文件写、网络请求、进程、Agent 回合、对话读取、工具调用,也不涉及设备或宿主导航权限,新句子来自插件本来就在加载的字典。


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Agent 没能启动时不再只说暂时不可用,而是说清这一轮没跑、下一步该试什么。读不懂原因的宿主错误改用插件自己的句子,不再把宿主原文带进聊天。

@MyPrototypeWhat MyPrototypeWhat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

谢谢,改动只涉及失败提示文案和兜底,测试也补齐了,合了。

@MyPrototypeWhat
MyPrototypeWhat merged commit 9db264d into MiniMax-AI:main Nov 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants