feat(tasks): 任务列表新增「运行中 Worker」列

TaskListMetricsAll 增加一个 LATERAL 子查询统计 kind='intent' 且
state='running' 的节点数,随 TaskDTO.in_flight 一并返回,口径与任务
详情页概览的「运行中 Worker」完全一致。列表页在「目标进度」后新增该
列,无运行中 Worker 时显示 0。
This commit is contained in:
Autumn-27 committed 2026-09-08 14:25:49 -04:00
1 parent 4fba36b73d
commit f270ca66bc
4 files changed
+22 -4

No files matched your search

+1
View File
@@ -50,6 +50,7 @@ type TaskDTO struct {
Tokens TokenTotalDTO `json:"tokens"` // whole-task token consumption
GoalsTotal int `json:"goals_total"`
GoalsMet int `json:"goals_met"`
InFlight int `json:"in_flight"` // 运行中 Worker 数(state=running 的意图)
LLMProfileID *int64 `json:"llm_profile_id,omitempty"` // LLM profile used for this task; nil = default
LLMProfileIDs []int64 `json:"llm_profile_ids"`
ActiveLLMProfileID *int64 `json:"active_llm_profile_id,omitempty"`
+1
View File
@@ -1064,6 +1064,7 @@ func (s *Server) listTasks(w http.ResponseWriter, r *http.Request) {
}
dto.GoalsTotal = metric.Goals.Total
dto.GoalsMet = metric.Goals.Met
dto.InFlight = metric.RunningIntents
dtos = append(dtos, dto)
}
writeJSON(w, 200, map[string]any{"tasks": dtos, "active": active})