Repository navigation
fix(session): 在任务结果保存后写入归档完成标记 - #6153
Merged
Merged
Conversation
Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com>
qin-ctx
approved these changes
Oct 16, 2026
11 of 21 tasks
OnePerson2020
pushed a commit
to OnePerson2020/OpenViking
that referenced
this pull request
Oct 16, 2026
…ne#6153, upgrade notes for main 2026-10-16 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OnePerson2020
pushed a commit
to OnePerson2020/OpenViking
that referenced
this pull request
Oct 16, 2026
…ine#6153) Cherry-pick of volcengine#6153 (merged 2026-10-16, replaces our closed volcengine#6080). A failure saving the task result used to leave .done next to a failed task. .done still lands before the queue work is released, so _can_run_archive's predecessor re-check is unaffected. Test fails on the previous order. Drop on the next upgrade past volcengine#6153. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OnePerson2020
pushed a commit
to OnePerson2020/OpenViking
that referenced
this pull request
Oct 16, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OnePerson2020
pushed a commit
to OnePerson2020/OpenViking
that referenced
this pull request
Oct 16, 2026
Editing tests/session/test_session_commit.py pulled the whole file into the deploy gate, where 3 of its tests (unchanged upstream) spend ~250 s each in teardown next to the other gate files and test_commit_multiple_times then times out (alone the file runs in 26 s). The regression test now lives in test_session_done_marker.py; drop it with the volcengine#6153 cherry-pick. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OnePerson2020
pushed a commit
to OnePerson2020/OpenViking
that referenced
this pull request
Oct 16, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
qin-ctx
added a commit
that referenced
this pull request
Oct 16, 2026
Co-authored-by: qin-ptr <222410531+qin-ptr@users.noreply.github.com> Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com> (cherry picked from commit 015aa74)
qin-ctx
added a commit
that referenced
this pull request
Oct 19, 2026
Co-authored-by: qin-ptr <222410531+qin-ptr@users.noreply.github.com> Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com> (cherry picked from commit 015aa74)
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.
Description
Session 抽取完成后,当前先写归档
.done,再保存任务结果。如果保存结果失败,同一个异常分支又会写.failed.json,造成归档显示成功、任务显示失败。将现有
.done写入块移到tracker.complete()之后。当前队列工作仍未结清时,tracker.complete()只登记结果,任务最终状态仍由队列确认流程收尾。同一个“抽取完成后保存任务结果失败”的场景:
.done和.failed.json同时存在.failed.jsonHuman Involvement
Related Issue
关联 #6078,修复任务结果登记失败导致归档双标记的路径。
Type of Change
Changes Made
仅移动
_run_memory_extraction中现有完成标记的写入位置,让任务结果构造、保存都先于.done。Testing
I have added tests that prove my fix is effective or that my feature works
New and existing unit tests pass locally with my changes
I have tested this on the following platforms:
现有 commit resume、task-work contract、SessionCommit processor 测试共 28 项通过。
使用实际 Session、NamedQueue、任务中间件、TaskTracker 和 PersistentTaskStore,配合内存存储传输层做故障注入对照:旧顺序可重现双标记;新顺序下结果保存失败、
.done写入失败均只留下失败标记,任务最终失败;正常路径最终成功。验证写
.done时和队列确认前,任务仍为 running,没有提前宣告完成。Ruff check、format check 和 diff check 通过。未新增或修改测试文件。
Checklist
Screenshots (if applicable)
不适用。
Additional Notes
Diff 为原有 14 行代码的位置移动,净增 0 行,没有新增分支或状态。