AI会话任务修复:P1 review状态独立映射+前端待确认提示,P2 移除next_run_at列+删除firePrompt死代码

This commit is contained in:
maogeigei committed 2026-08-31 17:47:47 +08:00
1 parent 6cbdb705b1
commit 26c707c357
4 files changed
+20 -28

No files matched your search

+9
View File
@@ -443,3 +443,12 @@
## 俊希用例收尾:验收表标注 + 提交(17:32)
- 用例文档验收汇总表 TC-09 行标注「✅ 界面模拟点击已实测 PASS(安全模式)」,真实触发任务需 `--confirm`
- 提交链:86ca4ca(初版用例)→ f320eb4(数据判定+脚本)→ 30fff47(日志)→ ffbdc87(验收表标注);已 push origin main,HEAD=ffbdc87 与远程一致
## AI会话任务链路审计 + P1/P2 修复(17:35-17:50)
- 用户要求:①先检查所有功能调用 AI 会话任务的代码是否正确;②P1 P2 需要修复;③核对「AI 任务执行时对应按钮是否处于处理中状态」的状态代码
- **审计结论(链路整体正确)**:后端 3 接口(/api/run POST 写 automations、/api/run/status GET 轮询、/api/ai/topics AI选题)+ 前端 executeTask/confirmRun/confirmSaveAccount/confirmAiScript 4 函数 + 7 个调用点(账号列表 AI写脚本/周榜分析/首页关注/账号详情改写+提炼/改写页/分镜生成/复盘评分)逐字段核对;automations 写入与既有任务一致(model=deepseek-v4-flash、permission_mode=fullAccess、owner_status=confirmed、once+now、cwds=D:/AgentSkill/mcn-workshop)
- **P1 修复(假等待)**:实测「导入指令」任务 status=PENDING_REVIEW、result_success=0、thread_title=`Automation prompt interrupted: user_cancel`(被中断/待确认)→ server.js `/api/run/status` 将 PENDING_REVIEW 从 pending 拆为独立 `review` 状态;app.js executeTask 新增 `finished` 标志 + review 分支(toast「⏸ 任务待确认,请到左侧会话栏确认执行」+ 停止轮询)+ 30min 超时提示「⏳ 任务仍在执行,请到左侧会话栏查看进度」
- **P2 修复两处**:①server.js `/api/run` INSERT 去掉 next_run_at 列(原写 Date.now() 毫秒,与既有任务全 None 不符,执行器用 scheduled_at/created_at),17 列→16 列;②data-pages.js 删除 firePrompt 死代码(L49-65,无调用者,executeTask 已取代)
- **按钮处理中状态核对(正确)**:executeTask 内 btn.disabled=true + innerHTML='执行中…' + classList.add('btn-busy');失败/完成/超时/review 均 restore(disabled=false + 原 innerHTML + 移除 btn-busy)→ 无遗漏
- **验证通过(17:47)**:新服务启动(node PID 34480,HTTP 200);`/api/run/status?id=automation-1787881991955` 返回 `state:"review"`(修复前映射 pending)→ P1 生效;三文件语法检查通过
- git:本地 commit 本轮修复(按新策略暂不 push,攒到半天统一推)