Skip to content

Support sequential state propagation for batch tool calls #33832

Description

@yorkew-east8

Checked other resources

  • This is a feature request, not a bug report or usage question.
  • I added a clear and descriptive title that summarizes the feature request.
  • I used the GitHub search to find a similar feature request and didn't find it.
  • I checked the LangChain documentation and API reference to see if this feature already exists.
  • This is not related to the langchain-community package.

Feature Description

Feature Request: Support sequential state propagation for batch tool calls

Current behavior: When an LLM returns multiple tool calls at once, all tools execute based on the same initial state snapshot.

Use Case

When tools have dependencies on each other, subsequent tools need access to the state updates made by previous tools.

When developing a multi-tool Agent, I found that if an LLM returns multiple ToolCalls at once, subsequent tools do not get the updated state of a previous tool, leading to unexpected computations. I do not want to force the LLM to call tools one by one, as this seems to slow down the response. I think synchronizing the state between multiple ToolCalls would be more intuitive, at least there should be a toggle switch provided in the interface.

Proposed Solution

Add a configuration option (e.g., sequential_tool_execution=True) that ensures the first tool's Command state updates take effect before the second tool executes.

Alternatives Considered

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    externalfeature requestRequest for an enhancement / additional functionalitylangchain`langchain` package issues & PRs

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions