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