From aaad55cdaba5a0ca3d016ef38e27c753cff68e1b Mon Sep 17 00:00:00 2001 From: ymq Date: Tue, 11 Aug 2026 15:11:09 +0800 Subject: [PATCH] feat: markdown table format for list_tasks with emoji --- pipeline_service/agent_loop_v2.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) 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):