From 9788f9f7de9135c3b7669d8eb3b08425938277f8 Mon Sep 17 00:00:00 2001 From: DBT Date: Sat, 28 Feb 2026 06:25:10 +0000 Subject: [PATCH] autonomy M1 phase4: expose last pause reason/time in task queue API and task detail view --- pkg/nodes/registry_server.go | 20 +++++++++++--------- webui/src/i18n/index.ts | 4 ++++ webui/src/pages/TaskAudit.tsx | 13 +++++++++++++ 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/pkg/nodes/registry_server.go b/pkg/nodes/registry_server.go index dcd8280..cc9fd9f 100644 --- a/pkg/nodes/registry_server.go +++ b/pkg/nodes/registry_server.go @@ -1455,15 +1455,17 @@ func (s *RegistryServer) handleWebUITaskQueue(w http.ResponseWriter, r *http.Req continue } row := map[string]interface{}{ - "task_id": id, - "time": t["updated_at"], - "status": t["status"], - "source": t["source"], - "idle_run": true, - "input_preview": t["content"], - "block_reason": t["block_reason"], - "logs": []string{fmt.Sprintf("autonomy state: %v", t["status"])}, - "retry_count": 0, + "task_id": id, + "time": t["updated_at"], + "status": t["status"], + "source": t["source"], + "idle_run": true, + "input_preview": t["content"], + "block_reason": t["block_reason"], + "last_pause_reason": t["last_pause_reason"], + "last_pause_at": t["last_pause_at"], + "logs": []string{fmt.Sprintf("autonomy state: %v", t["status"])}, + "retry_count": 0, } items = append(items, row) if fmt.Sprintf("%v", row["status"]) == "running" { diff --git a/webui/src/i18n/index.ts b/webui/src/i18n/index.ts index ea410b5..297d30f 100644 --- a/webui/src/i18n/index.ts +++ b/webui/src/i18n/index.ts @@ -19,6 +19,8 @@ const resources = { taskQueue: 'Task Queue', taskLogs: 'Task Logs', mediaSources: 'Media Sources', + lastPauseReason: 'Last Pause Reason', + lastPauseAt: 'Last Pause Time', error: 'Error', noTaskAudit: 'No task audit records', selectTask: 'Select a task from the left list', @@ -172,6 +174,8 @@ const resources = { taskQueue: '任务队列', taskLogs: '任务日志', mediaSources: '媒体来源', + lastPauseReason: '最近暂停原因', + lastPauseAt: '最近暂停时间', error: '错误', noTaskAudit: '暂无任务审计记录', selectTask: '请从左侧选择任务', diff --git a/webui/src/pages/TaskAudit.tsx b/webui/src/pages/TaskAudit.tsx index 8bb1980..d7d4fe1 100644 --- a/webui/src/pages/TaskAudit.tsx +++ b/webui/src/pages/TaskAudit.tsx @@ -13,6 +13,8 @@ type TaskAuditItem = { source?: string; idle_run?: boolean; block_reason?: string; + last_pause_reason?: string; + last_pause_at?: string; duration_ms?: number; retry_count?: number; error?: string; @@ -115,6 +117,17 @@ const TaskAudit: React.FC = () => {
{selected.block_reason || '-'}
+
+
+
{t('lastPauseReason')}
+
{selected.last_pause_reason || '-'}
+
+
+
{t('lastPauseAt')}
+
{selected.last_pause_at || '-'}
+
+
+
{t('taskLogs')}
{Array.isArray(selected.logs) && selected.logs.length ? selected.logs.join('\n') : '-'}