Skip to content

fix(minimax-bot): 重启后已完成的回复不再把请求判成待确认 - #190

Open
Apageoflove wants to merge 1 commit into
MiniMax-AI:mainfrom
Apageoflove:fix/restart-done-delivery
Open

Apageoflove wants to merge 1 commit into
MiniMax-AI:mainfrom
Apageoflove:fix/restart-done-delivery

Conversation

@Apageoflove

@Apageoflove Apageoflove commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

请求在回合开始前被标成 processing。如果进程在回复已经落盘、但 inbox 还没写下投递结果时退出,重启恢复只看“有没有关联回复”,有就标成 uncertain,不看回复到底是什么状态。

于是一条已经正常完成的回复也会把请求标成待确认。后续消息被这个 uncertain 闸门挡住,永远停在 held。

实测同一个崩溃窗口:

改前:
userDispatchState: 'uncertain'
replyStatus: 'done'
later request: { dispatchState: 'held', hostRuns: 0 }

改后:
userDispatchState: 'delivered'
replyStatus: 'done'
later request: { dispatchState: 'delivered', hostRuns: 1 }

引擎的重试路径本来就有更窄的规则:只有 interrupted、streaming 或 AGENT_OUTCOME_UNKNOWN 才算结果未知。重启恢复现在和它共用同一个判定函数,两处不会再各写一套。

恢复规则变成:关联回复结果未知 → uncertain;有回复且结果已知 → delivered;没有回复 → pending。adjusting 仍按原规则变成 held。

测试加了一条:磁盘上留下 processing 的用户消息和 done 的助手回复,重启后请求必须是 delivered,并且下一条消息能真正跑到 Host。这条在未改的 main 上是红的。全量 441 条串行通过。

版本号 0.7.46。当前 main 是 0.7.40;前面还有 #184(0.7.41)、#172(0.7.42)、#187(0.7.43)、#188(0.7.44)、deleteSchedule 修复(0.7.45),按这个顺序合。

验证范围:只有 Node 22 上的测试是实测的。真实 Host 和 Electron 我没跑过 —— 这一层是仅个人判断。


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

@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.

谢谢这次 minimax-bot 的重启恢复修复。现头 a2fee217 还不能合。

作者要修的 processing + done 窗口是对的,但恢复规则过宽。loadMessages 现在把「有关联回复、且不是 interrupted / streaming / AGENT_OUTCOME_UNKNOWN」都标成 delivered,不限于 status 为 done 的回复。因此 processing 的用户请求配上 status 为 error、errorCode 为 ETIMEDOUT 的回复,也会走这条路径。

活路径里,回复会先由 updateMessage 落盘,inbox 随后才写投递终态。Host 已经接手后再抛错时 safeToContinue 是 false,ETIMEDOUT 也不在可继续的错误码里,所以 inbox 会把请求写成 uncertain。如果进程停在这两步之间,当前实现会在重启后把请求标成 delivered,并放行后面的消息;现有 main 会停在 uncertain。

新测试只覆盖了 processing + done。请把 delivered 收窄到真正完成的回复(例如只对 status 为 done 的回复),并补上 processing + error/ETIMEDOUT 仍为 uncertain、后续请求保持 held 的测试。

请更新这个分支,我们再看新头。

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