Skip to content

fix(a2a): mark deployedBeforeCancel on pipeline cancel after deploy activity - #204

Open
ruanzhengxin-zhuxing wants to merge 1 commit into
mainfrom
harness/21136c73
Open

fix(a2a): mark deployedBeforeCancel on pipeline cancel after deploy activity#204
ruanzhengxin-zhuxing wants to merge 1 commit into
mainfrom
harness/21136c73

Conversation

@ruanzhengxin-zhuxing

Copy link
Copy Markdown
Collaborator

问题

Aone 需求 #84289704:Session 8fde0f19425b4a06b1473a9aeec63223 / 02b02665f3ff410d9c8d8df9f9e2addb 中,deploying 步骤已输出“部署成功/开始执行部署”后 17s~2min 内触发 pipeline_canceledpendingNormalHandoff.Outcome 仅记录 canceled,未区分“部署前取消”与“部署后取消”,存在云资源孤儿风险。

方案

取消发布前增加只读部署证据核对钩子 _deployed_before_cancel_evidence

  • 证据来源:snapshot stacks(CreateStack 已返回 stack_id 即视为已发起部署)+ cleanup 数据中的 pending/unavailable 资源。
  • 命中时在两条取消路径(executor CancelledError 分支、waiting-input sidecar cancel)的 pipeline_canceled terminal data 与 pipeline_handoff_ready handoff data 写入 deployedBeforeCancel: truedeployedStackIds,随 pendingTerminal / pendingNormalHandoff / normalHandoff 持久化,触发下游按 stack 证据对账。
  • 部署证据存在但 cleanup 台账无 pending 资源时,回退 cleanup.status=unavailable,避免下游误认为干净取消。
  • 不在取消路径自动 DeleteStack,避免误删用户资源;证据检测异常不阻断取消发布。

测试

  • 新增 6 个单测:证据检测(stacks/cleanup/无证据)、部署后取消端到端标注、部署前取消 payload 不变、handoff publication 携带证据并回退 unavailable cleanup。
  • tests/a2a 全量 1438 通过;ruff check / ty check 通过;全量 pytest 13259 通过(18 个失败项在基线 d470b40 上同样失败,属沙箱环境问题)。

…ctivity

pipeline_canceled could fire right after a successful deploy while
pendingNormalHandoff only recorded outcome=canceled, leaving no signal to
reconcile already-created ROS stacks (orphaned cloud resources).

Add a read-only deploy-evidence check before cancel publications:
- detect stacks from the A2A snapshot (CreateStack already returned a
  stack_id) and pending/unavailable cleanup evidence;
- stamp deployedBeforeCancel=true plus deployedStackIds on the
  pipeline_canceled terminal data and the switch_to_normal handoff data in
  both cancel paths (executor CancelledError branch and waiting-input
  sidecar cancel);
- when deploy evidence exists but the cleanup ledger has no pending
  resources, fall back to cleanup.status=unavailable so downstream must
  reconcile against the recorded stacks instead of assuming a clean cancel.

Evidence detection failures never block cancel publication.
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