Skip to content

fix(pipeline): drive terminal outcome from final step conclusion status - #194

Open
ruanzhengxin-zhuxing wants to merge 1 commit into
mainfrom
harness/496094ed
Open

fix(pipeline): drive terminal outcome from final step conclusion status#194
ruanzhengxin-zhuxing wants to merge 1 commit into
mainfrom
harness/496094ed

Conversation

@ruanzhengxin-zhuxing

Copy link
Copy Markdown
Collaborator

背景

针对 Session 8fc911f4c6204f85ab541ce352aaacce:deploying 步骤已出现 WAF 拦截(WAF_CLIENT_UNCLASSIFIED)与 quality_signals.failed_statuses=1,但 pendingTerminal 仍触发 pipeline_completedpendingNormalHandoff.Outcome=completed,形成假成功。

根因

终态 Outcome 只依据步骤执行状态,不看末步结论 statusdeploying 结论 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。
  • 新增 8 个单测。

测试

pytest tests/pipeline/engine/{test_pipeline_handoff,test_pipeline_observability,test_pipeline_runner,test_complete_step_tool}.py 298 passed;ruff 通过。

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant