Manager agent delegates task to wrong agent in a hierarchical process

I am working on the use case of a customer support system. This crew will helps to Categorizes the ticket as either a technical issue or a billing issue and assigns the ticket to the appropriate support agent and resolves the issue and provides solutions and finally reviews the solutions to ensure quality, trying to implement the hierarchical process, but here the manager agent is also executing the agent that is not related, in this case it suppose to execute only Techinical agent, but also exiecuting billing agent. For example if the input is I tried logging into my account today, but I keep receiving an ‘Invalid credentials’ error message., the manager able to categorize it as a technical issue and assign it to the technical support agent and resolve it, but the billing support agent is also executing it, but it is not related to this ticket. Below is the code snippet, please assist on how to make sure the manager agent delegates the task to the appropriate agent and not execute the billing support agent.


from crewai import Agent, Crew, Process, Task
from dotenv import load_dotenv

load_dotenv()

# Define the manager agent
manager = Agent(
    role="Customer Support Manager",
    goal="Oversee the support team to ensure timely and effective resolution of customer inquiries",
    backstory=(
        "You are a seasoned customer support manager with extensive experience in leading support teams. "
        "Your primary responsibility is to coordinate the efforts of support agents, ensuring that customer issues "
        "are addressed promptly and satisfactorily. You excel in task delegation, performance monitoring, and "
        "maintaining high standards of customer service."
    ),
    allow_delegation=True,
    verbose=True,
)

# Define the technical support agent
technical_support_agent = Agent(
    role="Technical Support Specialist",
    goal="Resolve technical issues reported by customers promptly and effectively",
    backstory=(
        "You are a highly skilled technical support specialist with a strong background in troubleshooting software and hardware issues. "
        "Your primary responsibility is to assist customers in resolving technical problems, ensuring their satisfaction and the smooth operation of their products."
    ),
    allow_delegation=False,
    verbose=True,
)

# Define the billing support agent
billing_support_agent = Agent(
    role="Billing Support Specialist",
    goal="Address customer inquiries related to billing, payments, and account management",
    backstory=(
        "You are an experienced billing support specialist with expertise in handling customer billing inquiries. "
        "Your main objective is to provide clear and accurate information regarding billing processes, resolve payment issues, and assist with account management to ensure customer satisfaction."
    ),
    allow_delegation=False,
    verbose=True,
)

# Define tasks
categorize_tickets = Task(
    description="Categorize the incoming customer support ticket: '{ticket} based on its content to determine if it is technical or billing-related.",
    expected_output="A categorized ticket labeled as 'Technical' or 'Billing'.",
    agent=manager,
)

resolve_technical_issues = Task(
    description="Resolve technical issues described in the ticket: '{ticket}'",
    expected_output="Detailed solutions provided to each technical issue.",
    agent=technical_support_agent,
)

resolve_billing_issues = Task(
    description="Resolve billing issues described in the ticket: '{ticket}'",
    expected_output="Comprehensive responses to each billing-related inquiry.",
    agent=billing_support_agent,
)

quality_assurance_review = Task(
    description="Review the resolutions provided for both technical and billing issues to ensure accuracy and customer satisfaction.",
    expected_output="A report confirming the quality and accuracy of the resolutions.",
    agent=manager,
)

# Instantiate your crew with a custom manager and hierarchical process
crew_q = Crew(
    agents=[technical_support_agent, billing_support_agent],
    tasks=[categorize_tickets, resolve_technical_issues, resolve_billing_issues, quality_assurance_review],
    manager_agent=manager,
    process=Process.hierarchical,
    verbose=True,
)

Thank you,
Siva Kumar