fix(pipeline): drive terminal outcome from final step conclusion status - #194
Open
ruanzhengxin-zhuxing wants to merge 1 commit into
Open
fix(pipeline): drive terminal outcome from final step conclusion status#194ruanzhengxin-zhuxing wants to merge 1 commit into
ruanzhengxin-zhuxing wants to merge 1 commit into
Conversation
Deploying (and any terminal) step could finish its agent turn yet conclude with status=failed/cancelled (WAF blocked CreateStack, statuses.failed>0, user cancel). The runner still emitted pipeline_completed(failed=False), so terminal_outcome_from_completed_event returned completed and pendingNormalHandoff.Outcome was recorded as completed — masking the real failure as a false success. Add terminal_outcome_from_final_conclusion() and have the runner reflect the final step's conclusion status in the PIPELINE_COMPLETED event (failed/ canceled) plus matching observability, so a failed/cancelled deployment yields a failed/canceled terminal outcome instead of completed.
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
8fc911f4c6204f85ab541ce352aaacce:deploying 步骤已出现 WAF 拦截(WAF_CLIENT_UNCLASSIFIED)与quality_signals.failed_statuses=1,但pendingTerminal仍触发pipeline_completed、pendingNormalHandoff.Outcome=completed,形成假成功。根因
终态 Outcome 只依据步骤执行状态,不看末步结论
status。deploying结论status=failed/cancelled时仍走emit_pipeline_completed(failed=False),terminal_outcome_from_completed_event缺省返回completed。改动
handoff.py:新增terminal_outcome_from_final_conclusion(),把末步结论status映射为 failed/canceled(success/未知返回 None,不干预)。pipeline_runner.py:新增_terminal_conclusion_outcome_data(),在 auto_advance 终态与循环收尾终态分支据末步结论向PIPELINE_COMPLETED注入failed/canceled并对齐 observability。测试
pytest tests/pipeline/engine/{test_pipeline_handoff,test_pipeline_observability,test_pipeline_runner,test_complete_step_tool}.py298 passed;ruff 通过。