feat: root agent hierarchy at Level 1 from both orchestrators
Gemini and OpenAI orchestrators now inject _agent_level=1 into spawn_agent args so the full 3-level chain works: Persona (L1) → Specialist (L2) → Support (L3, cannot delegate further). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -509,6 +509,8 @@ async def _execute_tool(
|
||||
args = json.loads(arguments_json)
|
||||
except json.JSONDecodeError:
|
||||
args = {}
|
||||
if name == "spawn_agent":
|
||||
args = {**args, "_agent_level": 1}
|
||||
try:
|
||||
return await call_tool(name, args, callables)
|
||||
except Exception as e:
|
||||
@@ -524,6 +526,8 @@ async def _execute_tool_dict(
|
||||
) -> str:
|
||||
"""Execute a tool from a pre-parsed args dict."""
|
||||
_, callables = get_tools_for_role(user_role, tool_list)
|
||||
if name == "spawn_agent":
|
||||
args = {**args, "_agent_level": 1}
|
||||
try:
|
||||
return await call_tool(name, args, callables)
|
||||
except Exception as e:
|
||||
|
||||
@@ -468,6 +468,8 @@ async def _claude_handoff(
|
||||
|
||||
async def _execute_tool(name: str, args: dict, callables: dict | None = None) -> str:
|
||||
"""Execute a single tool call, catching all exceptions."""
|
||||
if name == "spawn_agent":
|
||||
args = {**args, "_agent_level": 1}
|
||||
try:
|
||||
return await call_tool(name, args, callables)
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user