From 7673a7acdfac8fb6815008c726f924063c6743e3 Mon Sep 17 00:00:00 2001 From: ymq Date: Sun, 16 Aug 2026 23:40:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(task=5Fcapability):=20claim=5Ftask=20?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=94=A8=E5=8E=9F=E6=A0=B7=20role(=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E5=AD=98=E9=87=8F=E8=A3=B8=E5=90=8D)=EF=BC=8C?= =?UTF-8?q?=E5=AE=A1=E8=AE=A1=E8=AE=B0=E5=BD=95=E7=94=A8=E8=A7=84=E8=8C=83?= =?UTF-8?q?=E5=90=8D=20agent.{role}?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline_service/task_capability.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pipeline_service/task_capability.py b/pipeline_service/task_capability.py index 3925e85..5b4e52f 100644 --- a/pipeline_service/task_capability.py +++ b/pipeline_service/task_capability.py @@ -76,7 +76,7 @@ async def claim_task(tenant_id, role, agent_id, from_state=S_SUBMITTED, 返回 (ok, task_id_or_message)。 """ - role = _normalize_role(role) + role_norm = _normalize_role(role) # 审计记录用规范名;查询用原样(兼容存量裸名数据) db, dbname = _get_db() async with db.sqlorContext(dbname) as sor: claim_token = agent_id or getID() @@ -100,7 +100,7 @@ async def claim_task(tenant_id, role, agent_id, from_state=S_SUBMITTED, return False, "认领竞争失败(已被他人认领)" await record_audit(tenant_id, 'pipeline_tasks', task_id, 'claim', from_state=from_state, to_state=to_state, - who=role, agent_id=agent_id, sor=sor) + who=role_norm, agent_id=agent_id, sor=sor) return True, task_id