Skip to content

Commit 81c14d6

Browse files
committed
add handle edge cases for sub_agents being null or {}
1 parent 24bd24c commit 81c14d6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/core/orchestrator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ async def run_main_agent(
767767

768768
# 2. Get tool definitions
769769
tool_definitions = await self.main_agent_tool_manager.get_all_tool_definitions()
770-
if self.cfg.sub_agents is not None:
770+
if self.cfg.sub_agents is not None and self.cfg.sub_agents:
771771
tool_definitions += expose_sub_agents_as_tools(self.cfg.sub_agents)
772772
if not tool_definitions:
773773
logger.debug(

src/core/pipeline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ async def execute_task_pipeline(
8686

8787
# Initialize sub agent LLM client
8888
# Require agent-specific LLM configuration for sub-agents
89-
if cfg.sub_agents:
89+
if cfg.sub_agents is not None and cfg.sub_agents:
9090
first_sub_agent = next(iter(cfg.sub_agents.values()))
9191
if hasattr(first_sub_agent, "llm") and first_sub_agent.llm is not None:
9292
sub_agent_llm_client = LLMClient(
@@ -180,7 +180,7 @@ def create_pipeline_components(cfg: DictConfig, logs_dir: str | None = None):
180180
)
181181

182182
sub_agent_tool_managers = {}
183-
if cfg.sub_agents is not None:
183+
if cfg.sub_agents is not None and cfg.sub_agents:
184184
for sub_agent in cfg.sub_agents:
185185
sub_agent_mcp_server_configs, sub_agent_blacklist = (
186186
create_mcp_server_parameters(cfg, cfg.sub_agents[sub_agent], logs_dir)

0 commit comments

Comments
 (0)