mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-04-29 12:10:57 +00:00
Make get_plugin_config defaults robust
Set a default None for the agent parameter and normalize project_name/agent_profile to empty strings when calling find_plugin_asset. This prevents None values from being forwarded to the asset lookup and avoids errors when project or profile are not provided.
This commit is contained in:
parent
7b2103125c
commit
5e4e7531a9
1 changed files with 2 additions and 2 deletions
|
|
@ -217,7 +217,7 @@ def get_webui_extensions(extension_point: str, filters: List[str] | None = None)
|
|||
return entries
|
||||
|
||||
|
||||
def get_plugin_config(plugin_name: str, agent: Agent | None, project_name:str|None=None, agent_profile:str|None=None):
|
||||
def get_plugin_config(plugin_name: str, agent: Agent | None=None, project_name:str|None=None, agent_profile:str|None=None):
|
||||
|
||||
if project_name is None and agent is not None:
|
||||
from python.helpers import projects
|
||||
|
|
@ -226,7 +226,7 @@ def get_plugin_config(plugin_name: str, agent: Agent | None, project_name:str|No
|
|||
agent_profile = agent.config.profile
|
||||
|
||||
# find config.json in all possible places
|
||||
file_path = find_plugin_asset(plugin_name, CONFIG_FILE_NAME, project_name=project_name, agent_profile=agent_profile)
|
||||
file_path = find_plugin_asset(plugin_name, CONFIG_FILE_NAME, project_name=project_name or "", agent_profile=agent_profile or "")
|
||||
# use default config if not found
|
||||
if not file_path:
|
||||
file_path = files.get_abs_path(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue