-
Notifications
You must be signed in to change notification settings - Fork 996
Closed
Copy link
Labels
agent orchestrationIssues related to agent orchestrationIssues related to agent orchestrationpythonv1.0Features being tracked for the version 1.0 GAFeatures being tracked for the version 1.0 GA
Description
Description
Currently, when HandoffBuilder._apply_auto_tools creates handoff tools for specialist agents, it doesn't use the agent's description. This means the auto-generated handoff tools have generic descriptions like "Handoff to the refund_agent agent" instead of more informative descriptions based on the actual agent's purpose.
Current Behavior
In _handoff.py:1160, the code calls:
tool = _create_handoff_tool(alias)This creates a handoff tool with a generic description.
Expected Behavior
When the target Executor is an AgentExecutor, the code should extract the agent's description from AgentExecutor._agent.description and pass it to _create_handoff_tool:
description = None
executor = specialists.get(exec_id)
if isinstance(executor, AgentExecutor):
agent = getattr(executor, '_agent', None)
description = getattr(agent, 'description', None)
tool = _create_handoff_tool(alias, description)Benefits
- More informative handoff tool descriptions for LLMs
- Better alignment with agent's actual purpose
- Improved tool selection by the coordinator agent
Files to Modify
python/packages/core/agent_framework/_workflows/_handoff.py: Update_apply_auto_toolsmethod (around line 1149-1172)
Related Code
_create_handoff_toolalready accepts an optionaldescriptionparameter (line 69)AgentExecutor._agentprovides access to the wrapped agent (line 94 in_agent_executor.py)
Metadata
Metadata
Assignees
Labels
agent orchestrationIssues related to agent orchestrationIssues related to agent orchestrationpythonv1.0Features being tracked for the version 1.0 GAFeatures being tracked for the version 1.0 GA
Type
Projects
Status
Done