Skip to content

Commit e18ba74

Browse files
committed
fix: Routing to supervisor if it is none
1 parent 6c5cd3b commit e18ba74

File tree

1 file changed

+3
-1
lines changed
  • libs/naas-abi-core/naas_abi_core/services/agent

1 file changed

+3
-1
lines changed

libs/naas-abi-core/naas_abi_core/services/agent/Agent.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,8 @@ def current_active_agent(self, state: ABIAgentState) -> Command:
874874
logger.debug(f"💬 Starting chatting with agent '{self.name}'")
875875
updated_system_prompt = state["system_prompt"]
876876
if (
877-
self.state.supervisor_agent != self.name
877+
self.state.supervisor_agent is not None
878+
and self.state.supervisor_agent != self.name
878879
and "SUPERVISOR SYSTEM PROMPT" not in state["system_prompt"]
879880
):
880881
# This agent is a subagent with a supervisor
@@ -1096,6 +1097,7 @@ def call_tools(self, state: ABIAgentState) -> list[Command]:
10961097
tool_response is not None
10971098
and hasattr(tool_response, "name")
10981099
and tool_response.name == "request_help"
1100+
and self._state.supervisor_agent is not None
10991101
and self._state.supervisor_agent != self.name
11001102
):
11011103
self._state.set_current_active_agent(self._state.supervisor_agent)

0 commit comments

Comments
 (0)