Command to subagent leads to calling of subagent and main agent parallely in the same step #8

Open
opened 2026-02-16 00:19:43 -05:00 by yindo · 0 comments
Owner

Originally created by @Dhruv-Maradiya on GitHub (Aug 27, 2025).

I am using langgraph_bigtools and have added few sub-agents with using tool-call as handoff. While handoff happens successfully it call the subagent and main agent parallely in the same step

Graph:

# Create main agent with custom tool retrieval logic
builder = create_agent(
    llm=effective_llm,
    tool_registry=tool_registry.get_tool_registry(),
    retrieve_tools_function=get_retrieve_tools_function(tool_space="general"),
    trim_messages_node=trim_messages_node,
)

# Add main agent nodes
builder.add_node("follow_up_actions", follow_up_actions_node)  # type: ignore[call-arg]
builder.add_node("delete_system_messages", delete_system_messages)  # type: ignore[call-arg]

# Add sub-agent graph nodes
builder.add_node("gmail_agent", gmail_agent)
builder.add_node("notion_agent", notion_agent)
builder.add_node("twitter_agent", twitter_agent)
builder.add_node("linkedin_agent", linkedin_agent)

From Tool:

return Command(
    goto=[Send(agent_name, agent_input)],
    update={"messages": state["messages"] + [tool_message]},
)

Here gmail_agent and first agent are at step 5 (this should not happen). second agent is intended with output of gmail_agent
Image

Originally created by @Dhruv-Maradiya on GitHub (Aug 27, 2025). I am using `langgraph_bigtools` and have added few sub-agents with using tool-call as handoff. While handoff happens successfully it call the `subagent` and `main agent` parallely in the same step Graph: ```python # Create main agent with custom tool retrieval logic builder = create_agent( llm=effective_llm, tool_registry=tool_registry.get_tool_registry(), retrieve_tools_function=get_retrieve_tools_function(tool_space="general"), trim_messages_node=trim_messages_node, ) # Add main agent nodes builder.add_node("follow_up_actions", follow_up_actions_node) # type: ignore[call-arg] builder.add_node("delete_system_messages", delete_system_messages) # type: ignore[call-arg] # Add sub-agent graph nodes builder.add_node("gmail_agent", gmail_agent) builder.add_node("notion_agent", notion_agent) builder.add_node("twitter_agent", twitter_agent) builder.add_node("linkedin_agent", linkedin_agent) ``` From Tool: ```python return Command( goto=[Send(agent_name, agent_input)], update={"messages": state["messages"] + [tool_message]}, ) ``` Here `gmail_agent` and first `agent` are at step 5 (this should not happen). second `agent` is intended with output of `gmail_agent` <img width="362" height="134" alt="Image" src="https://github.com/user-attachments/assets/1ad4662d-2211-4281-93f7-3088135004f8" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph-bigtool#8