Skip to content

Handoff tool not found: wrong tool name (duplicated suffix) when transferring to agent #60

Description

@JumpLink

Problem

When an agent that performs handoffs (in our case a router agent we created) tries to transfer to another agent (e.g. a “Code Refactorer”), it sometimes calls the handoff tool with a wrong name: the correct ID suffix is duplicated (e.g. ...7yu becomes ...7yu7yu). The tool is then not found on the host (handoff tools are graph-managed, not in the host’s loadTools), which leads to repeated failed handoffs and multiple “Transferred to Agent” messages without an actual transfer.

Observed: Several “Transferred to Agent” lines in a row, then the assistant reports that the transfer to the code refactorer failed.

Provider/Model: Scaleway / devstral-2-123b-instruct-2512

(The full ModelSpec configuration can be viewed here and the full Agents configuration here.)

Relevant logs

2026-02-17 13:41:29 warn: [ON_TOOL_EXECUTE] Tool "lc_transfer_to_agent_V_29lG4o1TnQ3-C0wu7yu7yu" not found. Available: 

2026-02-17 13:41:31 warn: [ON_TOOL_EXECUTE] Tool "lc_transfer_to_agent_V_29lG4o1TnQ3-C0wu7yu7yu" not found. Available: 

2026-02-17 13:41:32 warn: [ON_TOOL_EXECUTE] Tool "lc_transfer_to_agent_V_29lG4o1TnQ3-C0wu7yu7yu" not found. Available: 

2026-02-17 13:41:33 warn: [ON_TOOL_EXECUTE] Tool "lc_transfer_to_agent_V_29lG4o1TnQ3-C0wu7yu7yu" not found. Available: 

2026-02-17 13:41:34 warn: [ON_TOOL_EXECUTE] Tool "lc_transfer_to_agent_V_29lG4o1TnQ3-C0wu7yu7yu" not found. Available: 

2026-02-17 13:41:36 error: [api/server/controllers/agents/client.js #sendCompletion] Operation aborted 400 Cannot set `add_generation_prompt` to True when the last message is from the assistant. Consider using `continue_final_message` instead.

2026-02-17 13:41:36 error: [api/server/controllers/agents/client.js #sendCompletion] Unhandled error type 400 Cannot set `add_generation_prompt` to True when the last message is from the assistant. Consider using `continue_final_message` instead.

The correct tool name would be lc_transfer_to_agent_V_29lG4o1TnQ3-C0wu7yu (without the duplicated 7yu).

Screenshot

Image

Context

  • Handoff tools are created with names like lc_transfer_to_ + edge.to (agent ID). Edges/init do not duplicate the ID.
  • Possible mitigation: when a handoff tool name is “wrong” but prefix-matches a known handoff tool, return a ToolMessage to the LLM with the correct name so it can call the right tool in the next turn (instead of executing silently or leaving the host to report “tool not found”).

Activity

  1. danny-avila commented on May 8, 2026

    @danny-avila
    Collaborator

    Replacement fix is in #161. I closed #61 in favor of it because #161 keeps mistyped handoff-shaped calls in ToolNode's local unknown-tool path, prevents host ON_TOOL_EXECUTE leakage, and includes regression coverage for both plain graph handoffs and mixed event-driven host-tool flows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions