diff --git a/pipeline_service/agent_loop_v2.py b/pipeline_service/agent_loop_v2.py index d598150..0f1749c 100644 --- a/pipeline_service/agent_loop_v2.py +++ b/pipeline_service/agent_loop_v2.py @@ -603,13 +603,21 @@ class AgentExecutor: if not recs: return "暂无任务" - lines = [] + # 状态图标映射 + icons = { + "submitted": "⏳", "running": "🔄", "review": "👀", + "approved": "✅", "completed": "✔️", "failed": "❌", + "waiting": "⏸️", + } + lines = ["| 状态 | 任务 | 角色 | ID |", + "|------|------|------|----|"] for r in recs: - lines.append( - f"- [{getattr(r, 'state', '?')}] {getattr(r, 'title', '')} " - f"(角色: {getattr(r, 'role', '')}) " - f"id={getattr(r, 'id', '')[:8]}" - ) + st = getattr(r, 'state', '?') + icon = icons.get(st, "❓") + title = (getattr(r, 'title', '') or '')[:60] + role = getattr(r, 'role', '') + tid = getattr(r, 'id', '')[:8] + lines.append(f"| {icon} {st} | {title} | {role} | {tid} |") return "\n".join(lines) async def _t_task_detail(self, sor, p, pid):