Bug in Hierarchical Agent Teams tutorial: ResearchTeam node doesn't return results. #202

Closed
opened 2026-02-15 17:17:17 -05:00 by yindo · 2 comments
Owner

Originally created by @Thyme-Kirihara on GitHub (Mar 18, 2025).

Description:

The Hierarchical Agent Teams tutorial contains a bug in the ResearchTeam node implementation. The node processes data but doesn't return any results, causing an infinite loop and eventually a token limit exceeded error.

Steps to Reproduce:

Follow the tutorial instructions to create.
Run the Hierarchical Agent Teams tutorial code
Observe the error: "Branch condition returned unknown or null destination."
Eventually encounter: "This model's maximum context length is 128000 tokens."

Expected Behavior:

The ResearchTeam node should return the result of its operations to properly propagate the state through the graph.

Actual Behavior:

The ResearchTeam node processes data but doesn't return anything, causing the supervisor node to receive undefined values for routing decisions, resulting in an infinite loop.

.addNode("ResearchTeam", async (state) => {
  const getMessagesResult = await getMessages.invoke(state);
  const researchChainResult = await researchChain.invoke({
    messages: getMessagesResult.messages,
  });
  const joinGraphResult = await joinGraph.invoke({
    messages: researchChainResult.messages,
  });
  // No return statement!
})

Environment:

Node.js version: V23.10.0
LangGraph.js version: 0.2.56

About the fix:

I'm ready to submit a Pull Request with the fixed code.

Originally created by @Thyme-Kirihara on GitHub (Mar 18, 2025). # Description: The Hierarchical Agent Teams tutorial contains a bug in the ResearchTeam node implementation. The node processes data but doesn't return any results, causing an infinite loop and eventually a token limit exceeded error. # Steps to Reproduce: Follow the tutorial instructions to create. Run the Hierarchical Agent Teams tutorial code Observe the error: "Branch condition returned unknown or null destination." Eventually encounter: "This model's maximum context length is 128000 tokens." # Expected Behavior: The ResearchTeam node should return the result of its operations to properly propagate the state through the graph. # Actual Behavior: The ResearchTeam node processes data but doesn't return anything, causing the supervisor node to receive undefined values for routing decisions, resulting in an infinite loop. ``` .addNode("ResearchTeam", async (state) => { const getMessagesResult = await getMessages.invoke(state); const researchChainResult = await researchChain.invoke({ messages: getMessagesResult.messages, }); const joinGraphResult = await joinGraph.invoke({ messages: researchChainResult.messages, }); // No return statement! }) ``` # Environment: Node.js version: V23.10.0 LangGraph.js version: 0.2.56 # About the fix: I'm ready to submit a Pull Request with the fixed code.
yindo added the documentation label 2026-02-15 17:17:17 -05:00
yindo closed this issue 2026-02-15 17:17:17 -05:00
Author
Owner

@habberrih commented on GitHub (May 14, 2025):

@Thyme-Kirihara If you fixed the problem, can you share it?

@habberrih commented on GitHub (May 14, 2025): @Thyme-Kirihara If you fixed the problem, can you share it?
Author
Owner

@saba-ch commented on GitHub (Jul 17, 2025):

This PR closes this issue: #1353

@saba-ch commented on GitHub (Jul 17, 2025): This PR closes this issue: #1353
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#202