Here's a gnarly bug/issue..
Scenario:
- LLM invokes multiple instances of the same tool, such as ["Web Search", "Web Search"]
- This line schedules multiple tool nodes to run in parallel.
- Each tool node picks up the first matching tool call and here from the state -- this means that both of the web search tools will execute the first tool call.
- The fix is to use the langgraph send pattern here. Here's an old PR but you can use the same patterns here! 🙂