mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-17 22:41:57 +00:00
驳回不再记成失败(前端):终态按 end_reason 写「被驳回」,副标题写谁、在哪一步、备注
为什么:服务端已把人的驳回收成 cancelled + end_reason=rejected(上一个提交)。前端以前靠正则解析报错原文认驳回,而且只认 「人工驳回」一种,动作确认、工具调用审批、代码执行审批的三种原话都落到兜底、给出注定再失败的「继续运行」(05-已知遗留 (a))。 做了什么: - types.ts:Run.end_reason(rejected / stopped)。 - lib/status:新增状态 rejected(「被驳回」,同取消的剪影、不画红、终态),resolveStatus 按 endReason 区分;记录页列表、详情、 航迹的终点按它写「被驳回 · 原话」。 - run/decode:run.cancelled 带 reason=rejected 时标题写「被驳回」,副标题「张工 驳回了「付款」:金额不对」(超时驳回写按设置 驳回、不重复备注),指向那一步;手动停止、老事件照旧「已取消」。 - store/chat + ChatPage:终态里被驳回的一轮照 cancelled 收(不给继续运行),徽标写「被驳回」,补救区说明这是审批人的决定、 副标题写谁和备注;刷新之后从 meta.rejected 恢复;核对状态时按运行的 end_reason 认。 - lib/explain:正则只留给存量 failed+驳回,补上「未确认(被驳回)」「的调用已被驳回」「代码执行已被驳回」三种原话,一律不给继续运行。 - 继续运行被拒的说法改成「被驳回的运行不能继续运行:改好内容后重新发起」(check-copy 不收「接着跑」)。 - check-decode 加一节:reason=rejected 的标题、副标题、没署名没备注、超时驳回、相位、手动停止和老事件。 偏离:问数据的「之前的尝试」(retry 留档,W1-a 的地盘)里被驳回的那一次仍写「已手动停止」,没动。
This commit is contained in:
@@ -50,8 +50,8 @@ RUN_REJECTED = "run_rejected"
|
||||
#: 运行为什么结束在 cancelled(Run.end_reason,docs/design/next-round/00-总方案.md X9)
|
||||
END_REJECTED = "rejected"
|
||||
END_STOPPED = "stopped"
|
||||
#: 被驳回的运行不能接着跑:从断点重跑会读到同一个驳回答复、再停在同一处
|
||||
REJECTED_CONTINUE = "被驳回的运行不能接着跑:改好内容后重新发起"
|
||||
#: 被驳回的运行不能继续运行:从断点重跑会读到同一个驳回答复、再停在同一处
|
||||
REJECTED_CONTINUE = "被驳回的运行不能继续运行:改好内容后重新发起"
|
||||
#: 服务重启时还在排队的运行改成失败时写的话(run.error 和补发的 run.failed 是同一句)
|
||||
QUEUED_AT_RESTART = "服务重启时这次运行仍在排队,没有可恢复的进度,请重新发起运行"
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ async def test_the_api_carries_end_reason_and_refuses_to_continue_a_rejected_run
|
||||
assert (body["status"], body["end_reason"]) == ("cancelled", "rejected")
|
||||
r = await client.post(f"/api/runs/{run_id}/continue", json={})
|
||||
assert r.status_code == 409 and r.json()["code"] == "run_rejected"
|
||||
assert r.json()["detail"] == "被驳回的运行不能接着跑:改好内容后重新发起"
|
||||
assert r.json()["detail"] == "被驳回的运行不能继续运行:改好内容后重新发起"
|
||||
stop = await client.post(f"/api/runs/{run_id}/cancel")
|
||||
assert stop.status_code == 409 and "被驳回" in stop.json()["detail"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user