Skip to content

Inconsistent parent agent transfer instructions in agent_transfer.py #844

Closed

Description

@halfpasttense

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.

Activity

  1. seanzhou1023 commented on May 22, 2025

    @seanzhou1023
    Collaborator

    @halfpasttense thanks for reporting the issue, so what's your suggestion / expected behavior here ?

  2. added
    core
    on May 22, 2025
  3. added theissue type on May 22, 2025
  4. halfpasttense commented on May 22, 2025

    @halfpasttense
    Author

    @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.

  5. Jacksunwei commented on May 28, 2025

    @Jacksunwei
    Collaborator

    I think it makes sense dropping the prompt when disallow_transfer_to_parent=True . Sending a fix for this.

  6. added this to the FixIt Week milestone on May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

core

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions