fix(pipeline): re-emit step_started when resuming a waiting-input step - #207
Open
ruanzhengxin-zhuxing wants to merge 1 commit into
Open
fix(pipeline): re-emit step_started when resuming a waiting-input step#207ruanzhengxin-zhuxing wants to merge 1 commit into
ruanzhengxin-zhuxing wants to merge 1 commit into
Conversation
…p so run-event started/completed counts stay paired A waiting-input step (auto_advance=false, e.g. confirm_and_select) emits step_completed before pausing for user input, and emits step_completed again after the resume run processes the answer, while the resume path skipped step_started. Aggregated run-event counts then showed one more step_completed than step_started (observed 6:5 in session eadbf79d597b4e929827475e01612717). resume() now passes reemit_step_started=True so _continue_from_current re-emits STEP_STARTED for the same attempt (data.resumed=true) before re-running the step. resume_ask_user_question keeps the default because that flow never emitted step_completed before pausing.
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
eadbf79d597b4e929827475e01612717的 run 事件聚合计中step_completed=6而step_started=5,主步骤 started/completed 不配对。根因
等待输入步骤(
auto_advance=false,如confirm_and_select)在暂停前已 yieldSTEP_COMPLETED;用户回复后resume()走resume_waiting_step路径重入该步骤,恢复分支不再发STEP_STARTED,但处理完用户输入后又会再次 yieldSTEP_COMPLETED,导致同一步骤 1 个 started 对应 2 个 completed。候选子步骤candidate_*事件计数不受影响。修复
resume()传入reemit_step_started=True;_continue_from_current的resume_current_step分支据此补发与原步骤同 step_id/attempt 的STEP_STARTED(data.resumed=true)。resume_ask_user_question(暂停前未发STEP_COMPLETED)保持默认不补发,避免反向不配对。测试
test_resume_waiting_step_reemits_step_started_so_counts_stay_paired、test_resume_ask_user_question_does_not_reemit_step_started。test_prerequisites用例在未修改基线上同样失败,环境相关)。Harness WorkItem: 72e769e3-f852-4006-ac2a-ee04a6fd2d55