Files
Nexus/docs/changelog/2026-06-08-script-exec-global-progress-board.md
T
Nexus Agent 0b2d7ac50d feat(scripts): 异步执行、全局进度看板与完成提示音设置
脚本 exec 立即返回 running 并在后台跑批次;/ws/alerts 推送 script_progress/complete;
新增 ScriptRunsPage、Telegram 汇总通知与可配置的浏览器完成提示音。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 07:07:02 +08:00

2.1 KiB
Raw Blame History

2026-06-08 — 脚本执行:全局进度 + 看板 + Telegram 汇总

摘要

脚本批量执行改为真后台(API 立即返回 running);扩展 /ws/alerts 推送 script_progress / script_complete;全局顶栏进度条与完成 Alert+提示音;新建「脚本看板」页;Telegram 仅发成功/失败汇总与看板深链。

动机

366 台同步执行阻塞 HTTP 请求;用户需跨页面查看进度;失败明细应在看板而非 Telegram 长列表。

涉及文件

后端

  • server/application/services/script_service.pyasyncio 后台批次
  • server/application/services/script_execution_notify.py — WS + Telegram 编排
  • server/application/services/script_job_callback.py — 长任务终态通知
  • server/infrastructure/redis/script_execution_store.pyexecution_progress_stats
  • server/api/websocket.pybroadcast_script_progress/complete
  • server/infrastructure/telegram/__init__.pysend_telegram_script_summary
  • server/config.py / server/api/settings.pyNOTIFY_SCRIPT_COMPLETE

前端

  • frontend/src/composables/useScriptExecutionQueue.ts
  • frontend/src/composables/useWebSocket.ts
  • frontend/src/App.vue — 全局进度与完成 Alert
  • frontend/src/pages/ScriptRunsPage.vue — 第 15 页
  • frontend/src/pages/ScriptsPage.vue — 移除页内批量状态面板
  • frontend/src/router/index.ts / frontend/src/types/api.ts

文档

  • docs/project/nexus-functional-development-guide.md — 15 页 SSOT
  • docs/changelog/2026-06-08-script-exec-global-progress-board.md
  • docs/audit/2026-06-08-script-exec-global-progress-board.md

迁移 / 重启

  • 无需 DB 迁移
  • 需重启 API worker;前端 vite build 后部署 web/app/
  • 可选:在设置中配置 notify_script_complete

验证

pytest tests/test_script_execution_progress_stats.py tests/test_exec_detail_grouping.py -q
cd frontend && npm run build
bash scripts/local_verify.sh
  • 提交执行后 1s 内对话框关闭,顶栏显示「已进行 X 台,剩余 Y 台」
  • 结束:提示音 + AlertTelegram 仅汇总 + #/script-runs/{id} 链接
  • WS 断线:3s 轮询直至终态