diff --git a/pilot/base_modules/agent/controller.py b/pilot/base_modules/agent/controller.py index 47532a66b..92ca2f477 100644 --- a/pilot/base_modules/agent/controller.py +++ b/pilot/base_modules/agent/controller.py @@ -69,8 +69,10 @@ async def agent_hub_update(update_param: PluginHubParam = Body()): logger.info(f"agent_hub_update:{update_param.__dict__}") try: agent_hub = AgentHub(PLUGINS_DIR) + branch = update_param.branch if update_param.branch is not None and len(update_param.branch) > 0 else "main" + authorization = update_param.authorization if update_param.branch is not None and len(update_param.branch) > 0 else None agent_hub.refresh_hub_from_git( - update_param.url, update_param.branch, update_param.authorization + update_param.url, branch, authorization ) return Result.succ(None) except Exception as e: diff --git a/pilot/base_modules/agent/hub/agent_hub.py b/pilot/base_modules/agent/hub/agent_hub.py index 3af9c722e..29cd49fc3 100644 --- a/pilot/base_modules/agent/hub/agent_hub.py +++ b/pilot/base_modules/agent/hub/agent_hub.py @@ -125,7 +125,7 @@ class AgentHub: my_plugin_entity.version = hub_plugin.version return my_plugin_entity - def refresh_hub_from_git(self, github_repo: str = None, branch_name: str = None, authorization: str = None): + def refresh_hub_from_git(self, github_repo: str = None, branch_name: str = "main", authorization: str = None): logger.info("refresh_hub_by_git start!") update_from_git(self.temp_hub_file_path, github_repo, branch_name, authorization) git_plugins = scan_plugins(self.temp_hub_file_path)