feat(schedules): per-check cost and model summary on GET /schedules (INT-3)

agent_check items carry agentRuns (last 100 sessions: last/avg cost, 7-day count and cost,
models, recent 3); plan page and home plan band use it instead of fetching agent runs.
Migration 0052 indexes agent_run(created_by, created_at).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-29 17:55:47 +08:00
1 parent 82df5662f0
commit e681fcedf6
9 files changed
+200 -78

No files matched your search

+2
View File
@@ -82,6 +82,8 @@ agent_run 结束后,调度器每 15 秒回填一次,把 `scheduled_job_run.a
用户可以通过 `POST /schedules` 新建自定义巡检,id 形如 `check.custom.<8位>`。自定义巡检可以改名,也可以删除;内置任务只能停用。
`GET /schedules` 里每个巡检带 `agentRuns`:该巡检最近 100 次会话(`agent_run.created_by = schedule:<id>`,不含子代理)的上次 / 平均费用、近 7 天会话数与费用、最近用的上游与模型、按模型计数、最近 3 次会话。计划页卡片与首页计划带直接用它,不再各自拉会话列表。
## 排查
- 看板顶部显示「调度器未在线」:说明没有进程持有锁。检查 worker(io 组)是否在运行,以及它的日志里有没有「调度器取得执行权」。