feat: include failed step in task errors
This commit is contained in:
+3
-2
@@ -5,8 +5,8 @@
|
||||
|
||||
## 汇总
|
||||
|
||||
- 总任务:2
|
||||
- 状态统计:BLOCKED 0 · DOING 0 · DONE 2 · TODO 0
|
||||
- 总任务:3
|
||||
- 状态统计:BLOCKED 0 · DOING 0 · DONE 3 · TODO 0
|
||||
- 下一个可领取:暂无
|
||||
|
||||
## Phase 7
|
||||
@@ -14,6 +14,7 @@
|
||||
| ID | 任务 | 依赖 | 状态 |
|
||||
| --- | --- | --- | --- |
|
||||
| T-550 | ①②③ 批次下拉默认选中最新批次 | T-523, T-206 | DONE |
|
||||
| T-552 | 任务失败原因带上失败步骤(①②③ 阶段/状态列可见) | T-207, T-523 | DONE |
|
||||
|
||||
## Phase 8
|
||||
|
||||
|
||||
+7
-2
@@ -3,7 +3,7 @@ id: T-552
|
||||
title: 任务失败原因带上失败步骤(①②③ 阶段/状态列可见)
|
||||
phase: 7
|
||||
deps: [T-207, T-523]
|
||||
status: TODO
|
||||
status: DONE
|
||||
created: 2026-07-08
|
||||
---
|
||||
|
||||
@@ -43,4 +43,9 @@ created: 2026-07-08
|
||||
|
||||
## 执行记录
|
||||
|
||||
(做完在此记录:改了哪些文件、跑的验证命令与结果、决策)
|
||||
- 2026-07-08:完成 T-552。
|
||||
- 代码:`app/db.py` 新增 `FAILURE_STEP_LABELS`、`failure_step_label()`、`format_failure_error()`;`mark_failed()` 与 `set_applied()` 增加可选 `step` 参数,带 step 时把 `last_error` 统一保存为「<中文步骤>失败:<原因>」,无 step 时保持旧行为,已带步骤前缀时不重复添加。
|
||||
- 代码:①`CollectWorker` 采集失败时把当前 step 传给 `mark_failed`,并立即向 GUI 发出带步骤前缀的 `last_error`;②`app/ai.py` 的生成失败写库传入当前 title/cover step;③`ApplyWorker` 更新失败和异常失败传入当前 step 给 `set_applied`,默认归因为 `apply_task`,真实编辑器步骤仍由 `on_step` 覆盖。
|
||||
- 展示:①②③ 表格模型原本 tooltip 已读取 `last_error`,因此失败行悬停可直接看到失败步骤与原因;未新增列、不改 DB schema、不改 run_log_events。
|
||||
- 测试:`tests/test_db.py` 覆盖 `mark_failed` 带 step 前缀、未知 step 兜底、重复前缀不叠加、无 step 保持原样,以及 `set_applied` 更新失败 step 前缀;`tests/test_gui.py` 覆盖①②③失败行 tooltip 显示步骤与原因,并更新③ worker 失败原因断言。
|
||||
- 验证:`py -3.10 -m unittest discover -s tests -p "test_db.py"` 通过(9 tests);`py -3.10 -m unittest discover -s tests -p "test_gui.py"` 通过(104 tests);`py -3.10 -m unittest discover -s tests -p "test_ai.py"` 通过(40 tests);`python -m ruff check app tests main.py` 通过;`python -m ruff check scripts\gen_task_board.py tests\test_task_board.py` 通过;`py -3.10 -m compileall app main.py` 通过;`py -3.10 -m py_compile scripts/gen_task_board.py` 通过;`git diff --check` 通过;`py -3.10 -m unittest discover -s tests` 通过(257 tests)。
|
||||
|
||||
Reference in New Issue
Block a user