Repository navigation
fix(minimax-bot): 取消父任务时关闭子批次,不再永久泄漏 - #188
Open
Apageoflove wants to merge 1 commit into
Open
Apageoflove wants to merge 1 commit into
Apageoflove wants to merge 1 commit into
Conversation
This was referenced Dec 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
父任务可以等一个子批次。取消父任务时,子任务也被取消了,但子批次自己的通知状态还停在
pending。pending的批次算活跃批次,所以它永远不会被裁掉 —— 每取消一次委派,状态文件里就多留一个活批次。还有一个原因让它永远裁不掉:父任务对这个子批次的依赖也停在未消费状态。父任务已经被取消,不会再消费它,而
batchActive()会把“父任务还欠着这个依赖”的批次算作活跃。实测 40 次取消之后:
也就是
complete=true却又notification=pending,自相矛盾。释放占用的聊天再等 2 秒,40 个批次还是活跃的,不会自己收口。改了两处。取消依赖时,让子批次走已有的投递收口路径;那条路径本来就会把“父任务已取消”的批次标成
posted。同时把这个依赖标为已消费 —— 取消已经回答了它,不再欠着。这样batchActive()的两个判据都能正常结束,批次可以按原有规则归档。同一个 40 轮探针,改后是:
测试加了三条:父任务取消后子批次不再 pending 且不再活跃;查询不再自相矛盾;状态文件里不会留下“通知还是 pending、任务却已全部结算”的批次。三条在未改的 main 上都是红的,失败点都是等不到子批次关闭。全量 443 条过。
版本号 0.7.44。当前 main 是 0.7.40;前面还有 #184(0.7.41)、#172(0.7.42)、#187(0.7.43),按这个顺序合。
验证范围:只有 Node 22 上的测试是实测的。真实 Host 和 Electron 我没跑过 —— 这一层是仅个人判断。
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.