修复:checkName 接口语义反了,data=false 表示名称可用

This commit is contained in:
gitea committed 2026-04-08 00:15:07 +08:00
1 parent 4d9b0b8f35
commit c3c389146f
1 file changed
+2 -2
+2 -2
View File
@@ -4,9 +4,9 @@ from ekb_cli.api import EkbClient
def check_agent_name(client: EkbClient, name: str) -> bool:
"""检查名称是否可用:True=可用,False=已存在"""
"""检查名称是否可用:True=可用,False=已存在(接口 data=false 表示可用)"""
resp = client.get("/engine/hab/agent/checkName", name=name)
return resp.get("data", True)
return not resp.get("data", False)
def list_agents(client: EkbClient, page: int = 1, size: int = 1000) -> dict: