Repository navigation
fix(minimax-bot): 结果未知的任务会收口,已结算的批次不再只增不减 - #98
Open
Apageoflove wants to merge 2 commits into
Open
Apageoflove wants to merge 2 commits into
Apageoflove wants to merge 2 commits into
Conversation
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.
任务走到「结果未知」这一步以后,就再也不会动了。结果无法确认的回合不会被自动重放(它可能已经跑过了,重放可能重复一次回复或一个动作),这是对的;但它原来会把整个批次永远挂着:批次不完成、结果不投递给用户、取消也取消不掉。现在这一批次会收口——报告里写明这次的结果无法确认,批次像别的已结算批次一样被裁掉。
另一处是已结算的批次一直只增不减。它们留在状态文件里,每存一次盘就把整个文件重写一遍,于是文件随派发次数线性长大:60 个已结算批次加 2 个未结算批次占 117KB,派发 300 次后涨到 1.4MB、每存一次盘 16 毫秒;改好后状态文件停在 142KB、每存一次盘 3 毫秒。现在还在欠活的批次留下,最近 30 个已结算的留下,更早的只留一条不带回复的小记录(最近 1000 条这样的记录留着),回复本身从聊天记录里按页读回来,读不到的那条标成截断而不是悄悄少一截。被裁掉的批次仍然查得到:旧的 batch_id 仍然答,同一个 request_id 再派一次拿到的还是原来那件事,不会重跑一遍。
这些都在未改的上游代码上用探针复现过:任务落到 unknown 之后取消被拒、批次永不完成、0 条投递。新增的三个测试文件在未改的上游代码上是红的,在这版上是绿的;插件自带套件 314 条全过,上游 npm run check 两半也过。
这一版只改批次怎么收口与怎么裁剪,不改派发与重放。被裁掉的批次只留摘要不留完整回复,摘要留多久、回复从聊天记录里读回,这个取舍需要确认是不是上游想要的。
Need help on this PR? Tag
@codesmith-botwith what you need.