Skip to content

Agent calls a tool: transfer_to_<some_functionality> instead of just carrying out a conversation to capture data. #1239

@apiltamang

Description

@apiltamang

Question

Sometimes when I ask an agent to help me with a task, instead of helping with the task (which in this case is helping to fill out a form using a structured set of conversation states), the model attempts to call a tool like so:

2025-07-24 16:46:04 INFO     [Thread-2 (_setup_agent_session)] root: Agent started. Name: Game Order Agent
2025-07-24 16:46:04 INFO     [Thread-2 (_setup_agent_session)] root: event type received: raw_model_event
2025-07-24 16:46:04 INFO     [Thread-2 (_setup_agent_session)] root: event type received: history_updated
2025-07-24 16:46:05 INFO     [Thread-2 (_setup_agent_session)] root: event type received: raw_model_event
2025-07-24 16:46:05 INFO     [Thread-2 (_setup_agent_session)] root: event type received: history_added
2025-07-24 16:46:05 INFO     [Thread-2 (_setup_agent_session)] root: event type received: raw_model_event
2025-07-24 16:46:05 INFO     [Thread-2 (_setup_agent_session)] root: event type received: raw_model_event
2025-07-24 16:46:05 ERROR    [Thread-2 (_setup_agent_session)] root: Exception while processing event: Tool **transfer_to_game_order_agent** not found
2025-07-24 16:46:05 ERROR    [Thread-4 (_stream_to_openai)] root: Error sending audio. Exception: sent 1000 (OK); then received 1000 (OK)

The GameOrderAgent is declared like so: https://ctxt.io/2/AAD4IEHvFA

This gameOrderAgent is actually a handoff from a different customerServiceAgent who handled the initial caller greet like so:

game_order_agent = RealtimeAgent(
    name="Game Order Agent",
    instructions=open(f"{dir_path}/business_context_gameOrder.txt").read(),
    tools=[forward_call, capture_game_order_form, get_estimate],
    handoffs = []
)
customer_service_agent = RealtimeAgent(
    name="Customer Service Agent",
    instructions=open(f"{dir_path}/business_context_customer_service.txt").read(),
    tools=[forward_call, schedule_appointments],
    handoffs=[phone_order_agent, game_order_agent, item_return_agent]
)

Not sure why the model thinks it needs to call a tool. Initially the 'customer_service_agent' correctly handed off to 'game_order_agent' but now the gameOrderAgent calls a tool instead of just carrying along with a conversation.

Having dabbled some with the openai-agents-js, I know back there it mentioned that the handoffs or function calls are carried out by calling an internal transfer_to_ method. Thus I think this error maybe something systematic.

However, the model doesn't always end up like this. Sometimes it legit carries the conversation gathering important facts along the way.

Would appreciate any insight.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions