fix(pipeline): keep run event start/complete counts symmetric - #200
Open
ruanzhengxin-zhuxing wants to merge 1 commit into
Open
fix(pipeline): keep run event start/complete counts symmetric#200ruanzhengxin-zhuxing wants to merge 1 commit into
ruanzhengxin-zhuxing wants to merge 1 commit into
Conversation
- Re-emit a paired STEP_STARTED (marked resumed, same attempt) when a waiting-input step re-runs after user input, so its second STEP_COMPLETED no longer exceeds step_started in the a2a journal. - Clear resume_waiting/resume_running flags after a rollback so the rollback target emits a fresh STEP_STARTED instead of silently re-completing (evaluate_candidates repeated completion case). - Skip the trailing terminal block when the pipeline was already complete on entry, preventing a duplicate PIPELINE_COMPLETED while pipeline_started is only emitted once by run(). Ensures step_completed <= step_started and pipeline_completed <= pipeline_started for session 6bf1c83310104fbf9f21f7843bcbea10 class of runs.
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.
问题
证据 Session
6bf1c83310104fbf9f21f7843bcbea10的 run 事件统计中 step_completed=6 > step_started=5、pipeline_completed=2 > pipeline_started=1,完成事件多于开始事件,状态计数不对称。根因
pipeline_runner._continue_from_current:step_started;resume_waiting_step/resume_running_step标志,rollback 目标步骤(如 evaluate_candidates 校验失败修复后)走 resume 分支静默重完成;_continue_from_current时尾部重发pipeline_completed。修复
STEP_STARTED(resumed: true,attempt 不变);重启恢复不补发(journal 已有原 start)。STEP_STARTED。PIPELINE_COMPLETED。验证
TestStartCompleteEventPairing4 个单测(resume 配对 / restart 不重复 / rollback 配对 / 不重发 terminal)。Harness WorkItem: 693b8c40-74fc-4c4c-a8be-710fdb351e9f