You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inconsistent parent agent transfer instructions in agent_transfer.py #844
In _build_target_agents_instructions the output instructions include:
if agent.parent_agent:
si += f"""
Your parent agent is {agent.parent_agent.name}. If neither the other agents nor
you are best for answering the question according to the descriptions, transfer
to your parent agent. If you don't have parent agent, try answer by yourself.
"""
However, the list of transferrable agents may not include parent_agent if disallow_transfer_to_parent=True or if the parent_agent is not an LlmAgent. Under these conditions the instructions still say "If neither the other agents nor
you are best for answering the question according to the descriptions, transfer to your parent agent. " even though the parent cannot be transferred to.
It also makes no sense to say "If you don't have parent agent, try answer by yourself." since this is added only IF there is a parent_agent.
@seanzhou1023 I would probably take out that entire if statement. The instructions above it for agent transfer already covers transferring to the parent because the parent gets added to the target_agents list if it's capable of being transferred to. Unless there's a reason that an agent should know that it has a parent agent other than for purposes of transferring to it. But I'm not aware of such a reason. There's probably also no reason that an agent needs to distinguish between transferring to a parent versus any other agent transfer.
Activity
seanzhou1023 commentedon May 22, 2025
@halfpasttense thanks for reporting the issue, so what's your suggestion / expected behavior here ?
halfpasttense commentedon May 22, 2025
@seanzhou1023 I would probably take out that entire if statement. The instructions above it for agent transfer already covers transferring to the parent because the parent gets added to the target_agents list if it's capable of being transferred to. Unless there's a reason that an agent should know that it has a parent agent other than for purposes of transferring to it. But I'm not aware of such a reason. There's probably also no reason that an agent needs to distinguish between transferring to a parent versus any other agent transfer.
Jacksunwei commentedon May 28, 2025
I think it makes sense dropping the prompt when
disallow_transfer_to_parent=True. Sending a fix for this.chore: Don't add prompt about parent agent when `disallow_transfer_to…
chore: Don't add prompt about parent agent when `disallow_transfer_to…
chore: Don't add prompt about parent agent when `disallow_transfer_to…